B's goalie Tuukka Rask ties Tiny Thompson for the franchise record for career wins with 252.

BOSTON -- Chris Wagner scored on a blue-collar breakaway at the start of the third period, and Tuukka Rask tied Tiny Thompson for the franchise record for career wins as the Bruins scored a back-and-forth, 5-2 victory over the Blues at TD Garden Thursday night.

Wagner fought off Alex Pietrangelo’s backcheck to put a forehand move and shot past Jake Allen, 5:27 into the third period to break a 2-2 tie. Brad Marchand’s goal with 6:48 remaining, followed later by Sean Kuraly’s empty-net goal, assured Rask (28 saves) of recording his 252nd win with the Bruins, and extended his points streak to seven games (6-0-1).

Factoring in the Bruins’ second game in as many nights, Bruins coach Bruce Cassidy altered his lineup slightly. Defenseman John Moore, a healthy scratch for the previous three games, replaced Matt Grzelcyk as Kevan Miller’s partner, while former Blues captain David Backes, who didn’t dress on Wednesday in Philadelphia for the first time in three seasons as a Bruin, came in for Noel Acciari on a line with Sean Kuraly and Chris Wagner.

The line of Peter Cehlarik, who was summoned on Tuesday from AHL Providence as a potential linemate for David Krejci and Jake DeBrusk, remained intact. The trio had some of the Bruins’ best chances in a scoreless first period, especially in the final minute: Cehlarik, who scored twice on Wednesday against the Flyers, was stopped by Allen when he redirected Torey Krug’s pass through the slot (Krejci was denied on the rebound), and DeBrusk rushed into the right circle for a chance in the final second.

The line resurfaced early in the second period. Cehlarik’s nice one-tough pass gave Krejci room to navigate from the neutral zone into Blues territory as DeBrusk crashed the net. Krejci fed off the right wing boards to Krug trailing the rush, and Krug put his fifth goal of the season through DeBrusk’s traffic at 3:31.

That lead lasted less than a minute. The Blues made it 1-1 at 4:23, when lengthy possession time near the Bruins’ net resulted in Ryan O’Reilly’s 17th of the season. Rask stopped O’Reilly’s first try from just off the crease, but O’Reilly scored on the rebound.

The Blues made it 2-1 with a dominant shift against, of all lines, the Bruins’ Brad Marchand-Patrice Bergeron-David Pastrnak trio. Jaden Schwartz finally found defensemen Carl Gunnarson wide open in the high slot, and Gunnarson put the Blues ahead with a one-timer rocket over Rask’s glove at 13:36.

A Robert Bortuzzo cross-check against Kuraly gave the Bruins a late power-play opportunity, and the Bruins’ second unit tied the score with only a few seconds to spare. With Cehlarik’s board work helping to keep the puck alive, Krejci fed it back to Zdeno Chara at the right point. Chara took a step toward the middle and launched a shot that Backes, who was being taken down in the slot, still managed to deflect past Allen with exactly four minutes left before intermission.