TORONTO — The Detroit Red Wings feasted on a backup goaltender to build a cushy lead on one of the top teams in the NHL.

They still needed to go to overtime to close, but Dylan Larkin took care of that, scoring five-hole to secure a 5-4 victory against the Maple Leafs.

The Wings took a 4-1 lead into the third period Thursday at Scotiabank Arena on the strength of scoring from a couple unusual sources, and a fine night by the penalty killers. But the Leafs showed why they’re among the league leaders in offense, chipping away at the Wings’ lead with a furious third period.

It was the Wings’ third straight game against an offensive powerhouse, following a regulation loss to Colorado and a shootout loss to Tampa Bay. The Wings had a two-goal lead in the third period against the Lightning.

Rapid response

The way the Leafs swarmed Detroit’s zone from the opening faceoff, it was only a matter of time before they scored. Kasperi Kapanen did so at 4:50 of the first period when he was left alone by the left goal post and had an open net as Jonathan Bernier couldn’t slide over. The Wings made it 1-1 less than a minute later, when Thomas Vanek fed the puck to Jonathan Ericsson and he fired a shot while Andreas Athanasiou screened backup goaltender Garret Sparks.

Luke Glendening followed up with a goal at 6:38 to give the Wings a 2-1 lead, and then came an excellent penalty kill. On the second penalty kill (both drawn by Auston Matthews), Niklas Kronwall blocked a shot by John Tavares and Bernier ended up not even having to make a save.

With 12.2 left in the period, Gustav Nyquist angled a shot on net from the bottom of the left circle than went in off the far goal post. That added up to three goals on 11 shots for the Wings, and one goal on 10 shots for the Leafs.

Keeping the pressure

The Wings did a good job maintaining pressure in the second period, running up a 6-1 edge in shots when they went on a power play at 8:56. That stretch didn’t yield much as neither unit had much going, but they built on their lead shortly after the power play expired, when Mike Green fired a shot through traffic to make it 4-1 at 11:07.

They had to go on a third penalty kill at 12:33 when Kronwall put a shoulder-to-shoulder hit on Matthews and was called for boarding. Bernier helped take care of that. While they executed well killing penalties their power play again didn’t generate much when it got a second shot, at 15:36 of the second period. Overall, though, it was a good period, especially coming two nights after the Tampa Bay game, when the Wings took 12 shots in the first period but then only had 12 the rest of the game. They had 12 against the Leafs.

Lead leveled

The Wings opened the third period by killing the 1:20 left on a penalty to Kronwall, improving to four-for-four. But after that, the Leafs surged. Tavares used his quick release to score at 2:38, part of a 6-0 shot advantage as the Leafs changed their lines up and amended for their listless second period. Sparks made a big save on Larkin, and the Leafs rode their momentum to a 4-3 game when Zach Hyman scored at 8:50. Matthews bulled through the neutral zone and set up Andreas Johansson to force a tie less than three minutes later.