It was the Islanders' first power-play goal in 21 opportunities this season.
Desharnais made it 1-1 at 5:02 of the first period when he redirected Kevin Shattenkirk's wrist shot from the right point past Halak.
Goals by Nelson (6:06 of the first) and Barzal (1:15 of the second) gave the Islanders a 3-1 lead before Zuccarello got the Rangers back within one at 3:29 of the third. Lee turned the puck over at the Islanders blue line to Brendan Smith, who fed Zuccarello in front for an easy tap-in to make it 3-2.
"We definitely let them back in the game, and I take responsibility for that first one," Lee said. "But we held our game and held strong. They put a big push on there and we were able to win in a shootout."
The Rangers thought they tied the game with 7:53 left in the third period, but after video review it was ruled Smith had kicked the puck across the goal line.
But the Rangers did tie it 2:01 later when Hayes drove past Andrew Ladd and let go a soft backhand shot from the right side that got past Halak to make it 3-3.
"Obviously, it was an unfortunate bounce," Halak said. "Just one of those where I just tried to seal the post, and somehow it went in. It looked like the puck had eyes and found a way."