Calgary trails the Anaheim Ducks by two points for second place in the Pacific Division and leads the fourth-place Edmonton Oilers by one point.
"You take winning for granted a lot," Flames forward Kris Versteeg said. "Each time you win in this league is really tough, so you should be excited about it. You can dwell on certain things, but if you're winning, you can't be angry. This is a tough league to win in, and if you take wins for granted, then it's going to be an awfully long year."
David Backes gave the Bruins a 3-2 lead at 11:03 of the second period after leaving the game in the first because of an injury.
"It's maybe scary at the time, but you get back with the training staff and rub it and kiss it and make it feel better, and you're able to return to the game," Backes said. "The way guys were battling and playing for each other, I wanted to make sure that if there was a chance that I'd get back out there and try to help our team win another game."
Matt Beleskey ended a 21-game goal drought dating to Nov. 19 when he scored to put Boston ahead 4-2 at 3:36 of the third, and Pastrnak scored his 30th goal into an empty net to make it 5-2 with three seconds left.
Chiasson scored 9:23 into the first period to put the Flames up 1-0, but Pastrnak tied the game 2:24 later.
Marchand scored 6:04 into the second period to put Boston up 2-1 after Johnson mishandled a dump-in from the neutral zone, and Hamilton scored 1:10 later to tie it 2-2 when his dump-in from just inside center ice got past Khudobin.