NEW YORK (AP)Adam Pelech, Brock Nelson and Anders Lee scored third-period goals as the New York Islanders rallied for another comeback victory Tuesday night, 4-3 over the rival New York Rangers.

The Rangers were ahead 3-1 heading into the third at Madison Square Garden before Pelech scored his first of the season 14 seconds into the period.

Nelson tied it on the power play with his sixth goal at 12:46 before Lee put the Islanders ahead at 14:30. Kyle Palmieri also scored for the Islanders. Zach Parise had two assists.

Semyon Varlamov made 37 saves for the Islanders, who won for the seventh time in eight games.

”This team, we have confidence in each other,” Palmieri said. ”It’s a rivalry, an emotional game. We have guys with a lot of pride in the room.”

Lee said the quick third-period strike from Pelech provided a momentum shift, especially at a raucous Garden where the Islanders historically raise their level against their longtime rivals.

”It settled everything down, made it a one-goal game,” Lee said. ”Giving us that chance right away was huge … and this was a big game in a big building for both sides. These are games you want to win.”

It was the second straight night the Islanders rallied from a two-goal deficit in the third to win, doing the same against Calgary at home before scoring in overtime. They also rallied in similar fashion at home against Colorado for a 5-4 victory on Oct. 29.

”It speaks volumes to the character in this room,” added Lee, who leads the Islanders with eight goals. ”We know what we are capable of when we play the right way. This is a veteran group that has been through a lot.”

The Rangers lost their third straight at home and have only three wins in nine games at The Garden, where they were dominant last season, winning 27 of 41 games.

”A few mistakes made a big difference,” Rangers forward Artemi Panarin said.

The Islanders have outscored their opponents 25-11 in third periods this season. They blanked the Rangers 3-0 on Oct. 26 at home to start a five-game winning streak.

”Our guys have a lot of heart. They believe and they don’t quit,” Islanders coach Lane Lambert said. ”We played a solid road period, especially on a back-to-back.”

Filip Chytil, Chris Kreider and Vincent Trocheck scored for the Rangers. Igor Shesterkin made 22 saves in defeat.

”We lost a tough hockey game, tough to swallow,” coach Gerard Gallant said. ”We played well. We deserved the game tonight. The Islanders are the best team in the league in the third period. They scored three.”

Palmieri opened the scoring for the Islanders on the power play at 6:04 of the first with his fifth goal. Ryan Pulock and Parise assisted.

Chytil – in his second game back after a six-game absence due to injury – tied it at 11:36 of the first, beating Varlamov for his third goal.

K’Andre Miller and Adam Fox assisted. Fox has 10 points (two goals, eight assists) in his last 11 games.

The goal ended Varlamov’s shutout streak at Madison Square Garden. He had blanked the Rangers in each of his last four games at MSG, tying the record set by Ottawa’s Alec Connell in 1926 against the New York Americans for most consecutive road shutouts against one opponent.

The Rangers had a 14-12 shots advantage in the first.

Kreider put them ahead 22 seconds into the second on the power play with his fifth of the season to extend his point streak to six games. Assists went to Panarin and Trocheck.

Trocheck added to the lead at 13:47 of the second with another power-play goal. Panarin and Mika Zibanejad assisted on Trocheck’s fifth of the season.

Panarin leads the Rangers with 19 points, including 14 assists, and has points in 10 of New York’s 14 games this season.

The Rangers dominated the second, outshooting the Islanders 17-6 before the Islanders rallied in the third to stun the home crowd.

Six of the Rangers’ next seven games are on the road.

”We are going to keep grinding and keep trying to find consistency,” captain Jacob Trouba said. ”We didn’t play our best lockdown hockey. … This stings for sure.”

NOTES: The teams conclude their three-game season series Dec. 22 at The Garden. . Gallant and Lambert were teammates with the Detroit Red Wings for two seasons in the mid-1980s. . The Rangers scratched injured defenseman Ryan Lindgren and forwards Julien Gauthier and Ryan Reaves. … The Islanders scratched forward Cal Clutterbuck (injured Monday against Calgary) plus defenseman Robin Salo and forward Ross Johnston.

UP NEXT

Islanders: Host the Arizona Coyotes on Thursday.

Rangers: Visit the Detroit Red Wings on Thursday.

More AP NHL: https://apnews.com/hub/NHL and https://twitter.com/AP-Sports