Canada improved to 2-0 in Pool B and faces the United States on Sunday.
Defenceman Morgan Rielly had a goal and an assist for Canada, who trailed 2-0 after the first period. Ty Rattie, Mark Scheifele and captain Ryan Nugent-Hopkins also scored.
Defenceman Xavier Ouellet assisted on two Canadian goals. Goaltender Malcolm Subban stopped 25 of 28 shots for his second win of the tournament.
Canada was down to 10 forwards by early in the second period. Two were slapped with game misconducts and Boone Jenner was serving the second of a three-game suspension.
Marko Dano scored twice and Tomas Mikus also scored for Slovakia. Adam Nagy turned away 24 of 30 shots in Slovakia's net.