The Devils, who lead by eight points in the Atlantic Division, started Saturday nine behind Boston in the East.
Scott Clemmensen stopped 34 shots, but allowed goals to Sean Bergenheim, Jon Sim, Kyle Okposo and Bill Guerin.
Danis earned his second NHL shutout and first since Oct. 12, 2005. The Islanders (18-35-6), who have the worst record in the NHL, won for the second time in nine games (2-6-1). It was New York's first shutout of the season and their first in 79 games, dating to Rick DiPietro's 1-0 win over Tampa Bay exactly a year earlier.
Clemmensen left a bad rebound off Bergenheim's soft shot less than a minute into the game, but then denied his rebound attempt at an open net when he blocked the puck at the goal line with his outstretched stick paddle.
Bergenheim wouldn't be thwarted about 3 minutes later when after being dumped his own end he trailed teammate Mark Streit's rush up ice. He took a feed at the bottom of the right circle and snapped a shot in at 3:50.
It was a spirited first period for the Finnish forward, who might have been inspired by the presence of Hockey Hall of Famer Jari Kurri. Kurri is the general manager of Team Finland that will compete in next year's Vancouver Olympics.
New York took advantage of a terrible mistake by the Devils in front of Clemmensen to take a 2-0 lead early in the second.
Sim applied pressure behind the net, and Bobby Holik tried to get the puck out by passing it into the middle. At the bottom of the left circle, Devils defenseman Mike Rupp tried to corral the puck with his glove after it caromed off his skate, but it bounced right to Sim, who quickly sent in a backhander at 8:45.
Danis' best save in New Jersey's 12-shot first period came when Travis Zajac was alone in front and fired a rising drive that Danis tipped over the net.
He shined in the second when the Devils peppered him with 19 shots. New Jersey scoring leader Zach Parise, second in the NHL with 35 goals, had three whacks from in close but was stopped by Danis as he braced himself against the right post.
Danis also sticked away David Clarkson's one-timer with just over two minutes left in the period. The Devils closed that frame on a power play but couldn't solve the 27-year-old Danis, signed by the Islanders in July.
Okposo made it 3-0 with 3:53 left in the game, and Guerin added a power-play goal 1:45 later. Dainius Zubrus was then stopped on a sort-handed breakaway chance in the closing minutes.
Notes: Devils D Paul Martin missed his fourth straight game (upper-body soreness). ... Sim has scored in consecutive games after not having any between Dec. 16 and Thursday's loss to Carolina. ... Bergenheim went 11 games without a goal, dating to Jan. 2 at Phoenix. ... Danis stopped 39 of 40 shots - both previous career highs - in a 2-1 win over Anaheim on Jan. 21. ... Before Tuesday's 4-0 loss at Florida, the Devils hadn't been shut out on the road since April 8, 2008. ... The Islanders recalled D Joe Callahan from Bridgeport (AHL) and had him in the lineup along with LW Dean McAmmond, acquired Friday from Ottawa for C Mike Comrie and D Chris Campoli.