Elias Lindholm had a goal and an assist, and Morgan Geekie and Marc McLaughlin scored for the Bruins (17-13-3), who have won six of eight. Jeremy Swayman made 20 saves.
"It's big for our team," Boston defenseman Nikita Zadorov said. "I thought we had a really bad first period, and we gave up two really quick goals. After that we took over the game. It's not how we want to play but it's great to see the character in the room to come back."
Matt Coronato, Nazem Kadri and Ryan Lomberg scored, and Wolf made 31 saves for the Flames (15-11-6), who have lost four of six and eight of 11.
“To me, it was like a tale of two games," Calgary coach Ryan Huska said. "The first half, I really liked our game. I thought we had them on the run for a lot of the beginning portion of the game. And then I thought they flipped the script on us. They had us on the run. We took on some water in the third period. 'Wolfie' made some great saves to get us into overtime at that point.”
The Bruins scored twice in 2:37 in the third period to erase a two-goal deficit.
Geekie made it 3-2 at 4:14 when he scored on a rebound chance kicked into the slot, and McLaughlin poked a rebound by Wolf's outstretched left pad at 6:51 to tie it 3-3.
"You play until the last whistle every single game," Pastrnak said. "We obviously went through some hard times already during the season so it's important to show that we can learn and we're not going to give up and we're going to fight."