William Nylander got his first career hat trick, James van Riemsdyk scored his second of the game to break a tie with 1:36 left and the Toronto Maple Leafs snapped a three-game losing streak with a 6-5 win over the Boston Bruins on Saturday night.
Connor Brown also scored for Toronto, which moved one point behind Boston for third place in the Atlantic Division. The Maple Leafs have played five fewer games than the Bruins.
David Pastrnak scored two goals for Boston, and Ryan Spooner, Patrice Bergeron and Torey Krug each added one. Bergeron and Krug had power-play goals.
Frederik Andersen stopped 36 shots for the Maple Leafs.
Goaltender Tuukka Rask, playing his 12th consecutive game, was pulled after the Maple Leafs' fourth goal. Zane McIntyre made 10 saves in relief.
The Maple Leafs led 4-1 after getting three goals less than two minutes apart in the second period, but the Bruins charged back to tie it on Spooner's goal with 9:54 left in the third.
Brown banged home a shot from the slot to put Toronto back ahead, but Bergeron tied it again with 2:54 to play.
Van Riemsdyk scored from the right point, beating a screened McIntyre.
One of the loudest cheers of the night came when highlights of each of the Patriots' four Super Bowl victories was played on the Jumbotron — the biggest roar came on the clip of Malcolm Butler intercepting a pass at the goal line in 2015.
Seconds later, Toronto moved ahead 2-1 when Adam McQuaid's bad clearing pass caromed off the boards and ended up with van Riemsdyk alone in front. He tucked a shot under Rask's pads at 8:31.
On the ensuing shift, Bruins defenceman Kevan Miller fell down at centre ice and Nylander broke in alone on a 2-on-1 rush before firing a wrist shot over Rask's left shoulder. Bruins coach Claude Julien called timeout after the goal.
With McQuaid in the penalty box for holding, Nylander completed his hat trick and made it 4-1 by slipping a wrist shot into the net at 10:17.
But the Bruins rallied back.
Pastrnak's second goal came midway into the second. Krug's score sliced it to 4-3 at 15:53.
Boston had jumped in front 1-0 on Pastrnak's goal 2:17 into the game, but Toronto tied it when Nylander collected Nazem Kadri's pass, skated in alone and tucked the puck behind Rask.