Chris Kreider had a goal and an assist for the Rangers (53-22-4), who had won three straight. Igor Shesterkin made 25 saves.
The Rangers are first in the Metropolitan, three points ahead of the Carolina Hurricanes, who defeated the Boston Bruins 4-1 on Tuesday.
“I thought they came out with more intensity than we did. That’s got to be clear to everyone that watched the game,” Rangers forward Jimmy Vesey said. “They’re playing for their life, and even though we’ve played some teams that are in similar situations to them, I don’t think anyone came out that hard against us, and that was the difference in the game. I thought the rest of the game we pretty much took over.”
Mathew Barzal had a chance to give the Islanders the lead just 1:25 into the game after he was hooked on a breakaway by Adam Fox, but Shesterkin stopped his penalty shot attempt with his left pad.
Mike Reilly did give the Islanders a 1-0 lead at 4:12 when his centering pass for Barzal in front deflected in off the stick of Rangers defenseman Ryan Lindgren.
Horvat extended the lead to 2-0 at 11:47 with a redirection of Dobson's shot from the right point.
Kyle Palmieri made it 3-0 at 13:38. Brock Nelson missed the net a one-timer from the low slot, but he got the puck behind the net and passed it back out to the crease, where Palmieri tapped it into an open net with Shesterkin out of position.
Kreider got the Rangers to within 3-1 with a power-play goal at 7:47 of the second period. After Artemi Panarin double-clutched a one-timer, he was able to get a shot through for a redirection from Kreider in front.
"Any time a team's down 3-0 going into a period, they're looking to fight back," Reilly said. "We expected that. There was some penalty trouble a little bit, for sure, that ... kind of put us on our heels a little bit and (we) got away from the game that we were doing where we were playing fast, playing north, and kind of getting it behind their [defensemen] and creating a forecheck."
Fox cut it to 3-2 at 15:01 with another power-play goal, scoring blocker side with a point shot through traffic.
"We came out and played really strong in the first. We were unbelievable,” Varlamov said. “Then all of a sudden we start spending a lot of time in our zone and gave them momentum. And in the second period, they’re a good team, they score on the power play, unfortunately, but going into the third period with a lead, 3-2, was pretty good for us.”
The Rangers outshot the Islanders 13-4 in the third period, but Lee scored an empty-net goal at 19:54 for the 4-2 final.
Rangers forward Mika Zibanejad left the game at 8:51 of the third period after colliding with Islanders defenseman Adam Pelech at center ice.
“I think we owned the game. The puck was on our stick the entire second and third period,” Rangers coach Peter Laviolette said. “It was hard out there tonight, having to get through all of that. What we’re talking about. It was hard. But our guys kept fighting and battling to the end.”
NOTES: Varlamov is 5-1-0 with a 2.17 goals-against average, .939 save percentage and one shutout in his past six starts. ... Panarin's assist was his 70th of the season. He joined Brian Leetch (three times) as the only Rangers players to have multiple 70-assist seasons. ... Kreider has scored in four straight games. ... Dobson has 60 assists this season. He joined Denis Potvin (four times) as the only Islanders defensemen to reach the mark.