The Boston Bruins let a two-goal lead slip away Monday night, then got it back in the shootout. David Pastrnak scored the only goal of the tiebreaker as Boston beat the Vegas Golden Knights 3-2 at TD Garden for its sixth straight home win, NHL.com reported.

Pastrnak went backhand to forehand and tucked the puck past Carter Hart’s left skate. Jeremy Swayman made 21 saves for the Bruins, who improved to 11-4-1.

Hagens keeps scoring

James Hagens opened the scoring at 7:23 of the first period, chipping in a centering pass from Elias Lindholm. The 19-year-old rookie has four goals in his past seven games and six this season. NHL.com noted that the only other Bruins teenagers to score that many for the team since 2010-11 were Tyler Seguin and Pastrnak.

“It’s nice to be here. It’s nice to be part of this,” Hagens said. “Day by day you feel more comfortable and that comes with just the guys in this room.”

Early in the second period, Vegas forward Braeden Bowman got a five-minute major and a game misconduct for elbowing Boston’s Matthew Poitras. Morgan Geekie scored on the power play 34 seconds later, finishing a one-timer from Pavel Zacha to make it 2-0. Pastrnak’s assist on that goal gave him 300 career power-play points, making him the sixth player in Bruins history to reach the mark.

Vegas comes back

Mark Stone cut the lead to 2-1 with a power-play goal at 14:58 of the second, his 10th of the season. Trevor Connelly tied it at 7:23 of the third from a sharp angle off a feed from Noah Hanifin, and neither team scored in overtime. Mitch Marner had two assists to extend his point streak to 10 games for Vegas (9-5-2).

“It doesn’t really matter how you get them in this league because points are points,” Geekie said.

Poitras returned to the bench wearing a full face shield but did not take another shift, and coach Marco Sturm did not have an update after the game. The Bruins visit the Pittsburgh Penguins on Thursday at 7 p.m., then host the Florida Panthers on Sunday at 1 p.m.