NEW YORK — Tony DeAngelo scored the decisive goal in the seventh round of the shootout and the New York Rangers rallied from two goals down in the third period to beat the Boston Bruins 4-3 on Wednesday night.

Mika Zibanejad, Kevin Hayes and Filip Chytil scored for New York and Alexandar Georgiev finished with 27 saves. The Rangers won for the second time in five games (2-2-1) after a stretch in which they won four of five.

Danton Heinen, David Pastrnak and Patrice Bergeron scored for Boston, Brad Marchand had two assists, and Jaroslav Halak stopped 36 shots. The Bruins had a two-game winning streak end, but earned a point for the fifth straight game (2-0-3).

Zibanejad and Marchand scored in the third round of the tiebreaker, and the Rangers won it when David Krejci missed on the Bruins’ last attempt.

Each team had chances as they alternated odd-man rushes in the 3-on-3 overtime, with Halak making a sensational save to deny Zibanejad with 1:06 left. Halak earlier thwarted Chytil in front. On the other end, Georgiev stopped Sean Kuraly’s tip try with 1:23 to go.

Trailing 3-1, the Rangers pulled within one at 9:24 of the third when Jimmy Vesey sent a centering pass in front and Hayes poked it past Halak.

Chytil then tied it on a power play, knocking in the rebound of Pavel Buchnevich’s slap shot from the left side with 7:19 left.

The Bruins took the lead with a pair of goals 1:12 apart midway through the second.

First, Matt Grzelyck’s slap shot from the left point deflected off Heinen and past Georgiev with 9:23 left. It was Heinen’s seventh goal of the season.

Pastrnak then put Boston ahead with his 31st, deflecting a pass in front by Krejci into the right side.

Bergeron, who played in his 1,000th game Tuesday night in a home victory over the Islanders, gave the Bruins a two-goal lead, tipping Torey Krug’s pass in front for his 19th goal with 4:49 remaining. It was Boston’s third power-play goal in 17 chances over the last six games.

The Rangers outshot the Bruins 12-8 in the first period. Boston’s best chance came on Chris Wagner’s short-handed breakaway less than 2 1/2 minutes in.

Zibanejad gave the Rangers a 1-0 lead on a one-timer from between the circles with 2:15 left in the opening period. It was his 22nd goal of the season, and 11th in the last 12 games.

NOTES: Pastrnak has six goals and 13 points in his last 10 games. … Marchand has 11 assists and 14 points in his last nine games. … The Bruins have lost nine of the last 10 meetings (1-7-2) against the Rangers. … New York won the first meeting this season, 3-2 at Boston on Jan. 19. The teams conclude the season series March 27 at Boston.