Morocco, who needed a win or a draw in their final Group F match to reach the knockout rounds, opened the scoring on four minutes as Hakim Ziyech profited from a weak clearance by goalkeeper Milan Borjan.
Cheered on by a boisterous crowd of Moroccan fans, midfielder Ziyech effortlessly lobbed the ball over the stranded goalkeeper.
En-Nesyri remained dangerous throughout the first half, doubling Morocco's lead in the 23rd minute when he ran onto a long ball from Achraf Hakimi and beat Borjan at the near post.
En-Nesyri also thumped a volley into the Canadian net during stoppage time in the first half but that goal was ruled offside.
Moroccan defender Nayef Aguerd put Canada on the scoreboard with an own goal, the first of this World Cup, by accidentally flicking a cross by Sam Adekugbe past his own goalkeeper Yassine Bounou in the 40th minute.