The obituaries were being written for the Bruins’ 2013 season last night, and to be sure, they were not going to be kind.

But the B’s, on the brink of elimination and perhaps an offseason overhaul, simply rose from the dead.

After a hellacious, three-goal comeback in the third period, Patrice Bergeron — who had tied the game in the final minute of regulation — scored at 6:05 of overtime to give the B’s a 5-4 victory against the Toronto Maple Leafs that will be remembered for a long time.

“I don’t think I’ve ever been involved in anything like that,” said Milan Lucic, who reminded people why the Bruins believe he’s worth $6 million a year by racking up a goal, an assist and seven hits. “It feels good right now.

“At 4-1 with the clock winding down and half a period left, you start thinking to yourself, ‘Is this the end of this group here?’ Because it probably would have been if we didn’t win this game. But you have to have bounces, you have to have luck, you have to have everything go your way, and that’s basically what happened in the third period.”

The Bruins, who led 3-1 in series but lost Game 5 at the Garden on Friday and Game 6 in Toronto on Sunday, scored three goals in the final 10:42 of regulation to erase a 4-1 Leafs lead and send it to OT. Making it even more amazing was the fact the B’s scored two of those goals in the final 1:22 with Tuukka Rask on the bench for an extra skater.

The Leafs had a 2-1 lead after two periods on a pair of Cody Franson goals and scored twice early in the third (Phil Kessel at 2:09, Nazem Kadri at 5:29) to seemingly put a hammerlock on the series, especially with both Wade Redden and Andrew Ference out of the Bruins lineup and Dennis Seidenberg going down with a leg injury on the first shift of the game.