Bergeron, with his second of the night, ended it as the Bruins blitzed the Toronto goal. The Leafs could not clear the puck and the Bruins forward snapped home a shot.
Two late goals in the space of 31 seconds by Boston's Milan Lucic and Bergeron, with goalie Tuukka Rask off for the extra attacker, shockingly tied the game up at 4-4.
It had looked like two early goals by defenceman Cody Franson had been enough to propel Toronto into the next round of the playoffs. The Leafs led 4-1 midway through the third period when the Bruins started pulling rabbits out of their hat with three unanswered goals — the last two with the clock running out.
It marked the first time the Bruins have come back from a three-goal deficit in a playoff game since April 11, 1990, when they trailed the Hartford Whalers by a 5-2 score in the third period but went on to win 6-5.
The capacity crowd, which had been disgruntled most of the night, partied as it waited for an overtime period that never seemed in the cards.
Leading 2-1 entering the third period, Phil Kessel added an insurance goal at 2:09, poking in the puck into a gaping goal after Nazem Kadri hit the post. Kessel's fourth goal of the post-season was helped by a Bruins giveaway.
Kadri then scored on a two-one-one, banging home Kessel's rebound at 5:29 to seemingly hammer another nail in the Boston coffin.
At the other end, James Reimer seemed to have got into the Bruins' heads until Nathan Horton swept in a pass from Lucic, who swooped behind the net and then got the puck through traffic to his linemate to cut the lead to 4-2 at 9:18.
That sparked a late flurry by the Bruins and Lucic, stuffing in the puck from in close, scored with 1:22 remaining. Then Bergeron beat Reimer with 51 seconds left as hulking Bruins captain Zdeno Chara screened the Toronto goalie.
Rich Peverley had a chance to win it in the dying seconds but couldn't get good wood on it after a fat Reimer rebound.
The fourth-seeded Bruins, who dug their own hole by failing to finish off the Leafs in Games 5 and 6, started well but soon found themselves short on defencemen, discipline and inspiration. Upset at the officiating as the game wore on, the Boston players seemed preoccupied with a jab here, a punch there.
It was as if they were more interested in getting even on the ice than the scoreboard.
Boston began to looked tired and dispirited. The opportunistic Leafs, in contrast, grew in stature and confidence.
Franson, who had four goals in 45 games during the regular season, upped his playoff points total to three goals and three assists in seven games. Kadri and Kessel both had a goal and an assist while linemate James van Riemsdyk had two assists
The last Toronto defenceman to score two goals in a playoff game was Tomas Kaberle on April 14, 2003, against Philadelphia.
Matt Bartkowski, profiting from a Franson turnover, opened the scoring for Boston.
Inside the TD Garden, a sellout of 17,565 yellow-and-black faithful waved yellow towels. Back in Toronto, blue-and-white Leafs fans gathered at Maple Leaf Square.
The Bruins won Game 1 in Boston and Games 3 and 4 (in OT) in Toronto. The Leafs took Games 2 and 5 in Boston and Game 6 in Toronto.
After Game 6, Boston coach Claude Julien had talked of his Jekyll and Hyde team this season. The question facing Boston fans was which Bruins team would show up Monday.
The Bad Bruins — the team that exited the 2012 playoffs by losing Game 7 to Washington in 2012 and the one in 2010 that won three games against Philadelphia only to lose the next four. Or the Good Bruins — the team that won the Cup in 2011 by winning Game 7s against Montreal, Tampa Bay and Vancouver in the final.
Julien asked for a 60-minute effort and the Bruins came out bristling. David Krejci's line had three shots on goal in the first shift, including a two-on-one on Reimer.
Both team had injury issues.
Toronto was without injured centre Tyler Bozak (upper body) while Boston had problems on the blue-line with Andrew Ference and Wade Redden (undisclosed) both out.
Toronto's Joe Colborne played for the second night in a row while Dougie Hamilton and Bartkowski filled in on the Bruins blue-line. Defenceman Dennis Seidenberg dressed but only saw 37 seconds ice time on two shifts in the first period after an apparent injury.
That left Boston with five defenceman, two of whom had seen limited NHL action.
One of those five was Chara, who flattened Kessel and then van Riemsdyk early on. Colton Orr repaid the favour later in the first period.
The bottom fell out for Toronto at 5:39 when Franson tried an ill-advised pass between his legs from the boards inside the Toronto blue-line. It went straight to Bartkowski who skated in from the point and ripped a wrist shot past Reimer.
The fans started chanting Reimer, Reimer in derision. They should have been thanking Franson.
Rask preserved the lead minutes later, throwing out a leg to stop a Joffrey Lupul backhand as the Toronto winger raced in.
There was redemption for Franson at 9:35 when he banged a power-play goal in the dying seconds of a Chara penalty. It came after a goalmouth melee that saw van Riemsdyk and Lupul poking away at Rask and the puck in front. As a mountain of bodies grew by the crease, Franson tapped the puck into an empty goal to silence the crowd.
Tiring of the lack of production from the Brad Marchand-Bergeron-Tyler Seguin line, Julien replaced Seguin — pointless in the series — with the ageless Jaromir Jagr.
Toronto outshot the Bruins 12-7 in the first period and outhit the home side 18-12.
The second period was tight until Franson delivered a rocket from the point that went unseen past the right shoulder of a screened Rask at 5:48.
The Bruins' frustration was exemplified in the second period when Lucic, reacting to an unnoticed slash from Dion Phaneuf as the Toronto captain was on his butt behind the goal, was penalized for roughing. Lupul then knocked Rask's mask off with his knee in a goalmouth collision, enraging Chara.
Rask's glove hand kept the Boston in the game. At the other end, Reimer made an important stop on Marchand during a late power play in the period
Toronto outshot Boston 8-6 in the second.
The Boston roster held a huge edge in experience when it came to playing in a Game 7. Some 20 Bruins had already experienced a Game 7, with a combined total of 105 Game 7s between them.
As a franchise, the Bruins were 12-11 in Game 7s (11-7 on home ice) compared to 12-9 for Toronto (5-8 on the road).
In contrast, just five Leafs (Kessel, Lupul, Ryan O'Byrne, Phaneuf and van Riemsdyk) had been in a Game 7 — with Toronto's total at nine games.
Going into the series decider, Boston had outscored the Leafs 17-14 and outshot them 238-206. Toronto had outhit the Bruins 304-254.
NOTES — The Bruins' honorary fan captain for the game was Jarrod Clowery, who was injured at the Boston Marathon ... Coming into the game, Toronto held a 34-33-1 edge over Boston in post-season play, outscoring the Bruins 170-164.
Also on HuffPost