Patrik Elias took the puck in the Islanders zone, drew a defenceman down, and passed up to Gomez, who slid the puck in the short side past Rick DiPietro for his eighth goal.
Miroslav Satan tied the score with 0.7 seconds left on a power play tip-in off Martin Brodeur while the Islanders were on their second power play. It was Satan's 13th goal this season, and just his third in his last 13 games.
John Madden also scored for the Devils. Brodeur finished with 24 saves and was less than one second away from back-to-back shutouts at the Nassau Coliseum.
DiPietro made 28 saves as the Islanders lost their third straight at home. His toughest chances were back-to-back shots from Brian Gionta and Scott Gomez in the scoreless first period.
Brodeur had help from the post as Arron Asham's tip try rang off the iron nine minutes in.
DiPietro stopped Gomez with a pad save towards the end of the scoreless second period, as New Jersey was stopped on three power-play chances.
Again, DiPietro came up big in the final period, as he stopped Zach Parise's point-blank snap shot off a defensive turnover with 11 minutes left.
John Madden finally beat DiPietro with 74 seconds left in regulation to give New Jersey a 1-0 lead. He took a drop pass from Sergei Brylin and had a clear shot and beat DiPietro high to the stick side.
Notes: Since a mid-December losing streak, the Devils have only had two games where they didn't register a point in the standings (11-2-2). Two of those wins came against the Islanders. ... Jason Blake is the lone Islanders representative who will head to Dallas for the all-star Game, while Brodeur and defenceman Brian Rafalski will go for the Devils. ... Islanders defenceman Freddy Meyer played his first home game since he was traded for Alexei Zhitnik on Dec. 16. Meyer was out 10 games with a back injury, and his first three games in an Islander uniform were all on the road.