Matias Maccelli, Troy Stecher and Bobby McMann also scored for the Maple Leafs (26-21-9), who have won two games in a row after losing their previous six (0-5-1). Joseph Woll made 28 saves.

Nazem Kadri and Joel Farabee each had a goal and an assist for the Flames (22-27-6), who have lost six of their past seven games (1-4-2). Dustin Wolf made 18 saves.

Nylander put the Maple Leafs up 1-0 just 35 seconds into the first period. He skated in on a breakaway and snapped a shot from the high slot under Wolf’s glove. John Tavares started the play by knocking down a pass from Jonathan Huberdeau in the defensive zone.

Maccelli made it 2-0 at 7:17 of the second period. Nylander stole the puck along the end boards from Flames forward Morgan Frost and sent a backhand feed out to Maccelli, who buried a one-timer from the right hash marks.

It was his first goal since Jan. 10 (12 games).

Stetcher increased the lead to 3-0 at 9:10. He received a centering pass from Nylander in front, moved the puck to his backhand, and lifted a shot past Wolf, who was moving the other way.

Kadri made it 3-1 at 13:15, taking a pass from Farabee down low in the right circle and roofing a shot short side over Woll’s left shoulder.

Farabee cut it to 3-2 at 15:46 when he chipped in a backdoor pass from Kadri at the right post.

Woll stopped all 13 shots he faced in the third period, including diving to poke the puck away from Flames forward Adam Klapka after he got caught out of position behind his net.

Woll also got his shoulder on a shot by Matt Coronato at 16:15 that hit the crossbar and bounced down before Toronto defenseman Philippe Myers cleared it out of the crease.

McMann scored into an empty net at 19:35 for the 4-2 final.