Though tempted throughout a back-and-fourth affair at TD Garden on Thursday, the Bruins refused to let their head-to-head with the high-energy Calgary Flames slip out of their grasp, downing the Flames by a 6-4 final at TD Garden.

A win that featured almost everything you could have asked for in a midseason game against a non-conference opponent.

The Bruins opened this game up with an extended power-play — including a full 5-on-3 advantage for 1:55 — but somehow ended up in a deficit when Michael Frolik potted a shorthanded marker at the 7:46 mark of the first period. Boston defenseman John Moore made sure the Bruins got something for their lengthy power play start, connecting with a goal through traffic for his second goal of the season, scored just 1:16 after Frolik’s game-opening tally.

And both teams were absolutely off to the races from there , with eight goals scored over the next 45 minutes of action.

“Wasn’t our best effort, but that’s a really good team over there and they’re playing very well right now. So, it was a good test for us,” B’s winger Brad Marchand said. “We got the two points, which is ultimately what we need right now. But, I think we have to be happy to come off such a high last game with the Winter Classic and coming home, it sometimes can be kind of a letdown, but I thought we played really well. And again, that’s a very good team, so it feels good to beat them.”

Best effort or not, the Bruins did not lack heroes — especially from their skill positions — in this one.

One play that undoubtedly stood out in a game that was undeniably one in the third period, though, was a set play that saw Torey Krug hammer a slapshot off the boards and back towards David Pastrnak for a top notch look against Mike Smith.

Something B’s coach Bruce Cassidy always considered a possible play thanks to the team’s pre-scouting of the Flames.

“They stack the blue line pretty hard, and we were going to do it the first entry when we were all together in the first period . Those power plays kind of rolled together, so I don’t know how many entries we had, if any, with that group,” Cassidy said.

“We thought if anything it would back them off. We were just hoping it wouldn’t be icing or we’d get there at least first, or close to … tied so that maybe the next time up the ice they’re aware of it so they don’t hold the blue line as hard. It happened to work, [Pastrnak] had to crowd the puck, made a great move, so, good timing for it and great execution.”

I think we’ve done it three times this year where we’ve actually gotten a chance off of it, maybe two other times where we didn’t get a chance off of it,” Krug said of the play, adding that it worked out as perfect as they planned. “A great play by [Pastrnak] to collect it and bring it to his backhand. I think the first two times we connected on it he shot on it and on the other one [Brad Marchand] was the guy so. It’s a good courage-play to bring it to the backhand because you don’t know who is coming from the other side. Obviously it turned out to be a big goal in the game.”

Winger Jake DeBrusk popped two in the net, including the game-winning strike with 6:14 left in the third period, which came with Danton Heinen flipped into the B’s right wing spot in place of a struggling Ryan Donato.

Veteran netminder (and probable All-Star snub) Jaroslav Halak, meanwhile, finished with a 33-of-37 mark in the Boston crease, and battled through what was obviously not his night, as rebounds piled up in front of his net from start to finish.

“I thought he made, on the really Grade-A chances, some really great saves, and then some of the other ones I just think his rebound control was a little off,” Cassidy admitted after the win. “If he stops all the ones he’s supposed to then what?

“I thought his rebound control was what got him a little bit. Otherwise, he made a lot of good stops for us.”

The Bruins will welcome the Buffalo Sabres to TD Garden on Saturday night.