TORONTO—Canada is seeing a resurgence in its tech sector that has caught the attention of Microsoft Corp., Facebook Inc. and Alphabet Inc.’s Google, which have recently acquired local firms or pledged big projects here.

Yet that has left Canadian policy makers with a dilemma: How to encourage investment from big-name companies while at the same time nurturing homegrown, Canadian firms?

On...