BOSTON — Brad Marchand scored with 22 seconds left to lift the Boston Bruins over the Philadelphia Flyers 3-2 on Thursday night for their fifth straight win.

Marchand and David Pastrnak swiped at the rebound of a shot from the point by Zdeno Chara as the puck trickled behind goalie Alex Lyon. Marchand finally swept into the net for his fifth goal in his last three games. He scored overtime goals in Boston’s previous two victories against Montreal and Detroit.

Chara and Pastrnak had two assists each, and Riley Nash and Brian Gionta also scored for Boston, which won despite getting outshot 33-27 by the slumping Flyers.

Jakub Voracek and Jori Lehtera scored for Philadelphia, which is 0-4-1 in its last five and is clinging to third place in the Metropolitan Division.

Tuukka Rask had 31 saves for Boston and shut out the Flyers after Lehtera’s short-handed goal early in the second period tied it at 2.

Lyon made 24 saves for Philadelphia.

Nash tapped in a rebound after Pastrnak’s wraparound attempt at 9:14 of the first to tie it at 1, then Gionta scored on a breakaway with 26 seconds left in the period to give Boston a 2-1 lead. It was the first goal as a Bruin for Gionta, who signed with Boston after serving as captain for the U.S. Olympic team.

Lehtera tied it 7:21 into the second.

The Flyers took an early lead on Voracek’s power-play goal 1:38 into the game, just 9 seconds into a double-minor called on Kevan Miller for high sticking. Nolan Patrick set up Voracek’s one-timer from the right side with a backward pass through his legs.

Lyon got the start over Petr Mrazek, who was 0-3-1 in Philadelphia’s last four, including a 5-2 loss at home to Pittsburgh on Wednesday night.

NOTES: Bruins forward David Backes sat out the first of a three-game suspension for a hit on Detroit’s Frans Nielsen on Tuesday night. … The Bruins shut out the Flyers 3-0 on Dec. 2 in the first of three meetings this season. … The Bruins have owned the Flyers over the last few years, going 10-1-2 in the previous 13 games entering Thursday.