If there was ever a statement game for the Leafs to exorcise their Boston-based demons from their infamous playoff game from 2013, it occurred on Saturday night at TD Garden.

James van Riemsdyk fired home the game-winner with 1:36 left in the third period to give Toronto a 6-5 win against the Bruins, one of the teams that the Leafs will be dueling for a coveted playoff spot. The regulation victory halted a three-game losing streak and also thwarted Boston’s opportunity to earn at least a point in the standings.

“We’ve got a lot of firepower up front and there’s going to be swing in the games,” van Riemsdyk said to reporters after the game. “The good teams know how to handle adversity well and it was a good response game from us. We have to continue to play that way.”

The see-saw affair was an outing that hockey fans adore, and that coaches dread.

Both teams had defensive lapses, creating a brand of firewagon hockey reminiscent of the 80’s, when it was simply “last goal wins.” For good measure, Adam McQuaid got the better of Matt Martin in a spirited heavyweight bout.

William Nylander registered his first career hat trick, completing the feat in the second period with a power play tally that chased Bruins’ starter Tuukka Rask from the game.

At the time, the score was 4-1 Leafs. Yes, Twitter exploded with tired jokes.

Not that the skepticism was unjustified. As if on cue, the Bruins rallied with three consecutive goals to even the score in the third period.

Connor Brown and Patrice Bergeron then exchanged late goals, setting the table for JVR’s heroics.

“I’ve been in a number of these over the years where your club doesn’t win in a while and it’s usually ugly when you finally do win,” coach Mike Babcock said.

“That was the ugly one and we appreciate winning.”

Frederik Andersen made 36 saves for the win. Toronto’s next game is Monday night in Long Island.