UNIONDALE, N.Y. - This one had all the makings of a repeat performance for the New York Islanders against the New York Rangers.

The Metropolitan Division-leading Islanders had their way in three previous matchups this season — beating the defending Eastern Conference champions by three goals each time.

So when the Islanders scored 11 seconds in on Monday night and built a pair of two-goal leads, including one in the third period, it appeared they would remain perfect at home against division opponents.

Not so fast.

Defenceman Kevin Klein broke a tie with 4:32 left, capping the Rangers' three-goal third period in a 6-5 win.

The Rangers trailed 3-1 before getting even in the second, then fell behind 5-3 in the third. They escaped with their fourth straight win.

"I'm sure it was a fun game to watch. Not so sure either coach feels that way," said Derek Stepan, who scored the first of the Rangers' third-period goals.

Although it surely wasn't how Alain Vigneault drew up the game plan, he left Long Island with his 501st coaching victory, tying him with Pat Burns for 19th place on the NHL career list.

"We were down by two twice and the guys battled back," Klein said. "It was a wild one. We wanted to play a more defensive style against these guys."

Defenceman Ryan McDonagh had the first two-goal game of his career, and Chris Kreider, Stepan and Martin St. Louis also scored for the Rangers, who completed a 4-0 road trip.

It was the fifth time the Rangers swept a four-game trip.

"That was a real gut check for us," McDonagh said. "It feels really good right now. It's great how we stuck together."

The Rangers trail the Islanders by two points and have two games in hand.

Stepan and St. Louis scored 1:37 apart in the third to tie it. Cam Talbot made 38 saves and improved to 5-1-1 while filling in for injured goalie Henrik Lundqvist.

Talbot shook off his early gaffe that led to John Tavares' goal into an empty net 11 seconds in.

"We just kept fighting and fighting," he said. "The mindset is to just stop the next one. They've been scoring in bunches."

So have the Rangers, who have 22 goals during their winning streak.

Ryan Strome scored twice, and Tavares, Frans Nielsen and Johnny Boychuk had goals for the Islanders, who had a four-game winning streak snapped. They dropped to 18-3 against Metropolitan opponents — including 11-1 at home.

The Islanders had outscored the Rangers 13-4 this season. The teams will meet once more in the regular season.

Jaroslav Halak stopped 36 shots but struggled in his attempt to tie the Islanders record for wins in a season.

Klein won it with a shot from the right circle after a turnover in the neutral zone. Of his nine goals, four are game-winners.

St. Louis tied it 5-all after Boychuk was tripped in the neutral zone and gave up the puck, leading to the goal. It was St. Louis' first goal in 16 games.

"It's part of the game," Boychuk said. "No reason to panic. When we were up two, same thing. Just keep emotions in check and play your game."

The Rangers scored twice in 23 seconds to tie it 3-all in front of a split crowd filled with fans decked out in Islanders and Rangers colours.

Talbot immediately put his club in a hole when he went behind his net and attempted to pass the puck to McDonagh in the right corner. Tavares intercepted the errant pass and fired the puck into an empty net to make it 1-0.

"Obviously, I didn't want to start the game like that," Talbot said. "We just had to keep battling, just try to stay focused and keep fighting through."

That's exactly what he did. With his team down 2-0, Talbot stopped Casey Cizikas on a breakaway, keeping the Rangers close enough to rally.

NOTES: The Islanders had a season-best 22 shots in the first period. ... Kevin Hayes, who assisted on McDonagh's second goal, became the first Rangers rookie with a six-game point streak since Stepan in the 2010-11 season. ... The Rangers rallied from two multigoal deficits to win in regulation for the first time since Oct. 26, 1980, against Detroit.