Mike Sillinger also scored for New York, which has won four of the five meetings in regulation.
Travis Zajak scored for New Jersey, which had a three-game winning streak snapped in losing for only the seventh time in 26 games (19-5-1).
DiPietro was spectacular in the third period, stopping 15 of 16 shots, including one in close by Dainius Zubrus in the final 90 seconds that had the Devils center looking up at the rafters in the Prudential Center.
Guerin iced it with an empty-net goal seconds later, his ninth in 13 games.
DiPietro, who shut out the Devils in his only other game at the Prudential Center, had to work hard in the final six minutes to preserve the win.
Brian Gionta, whose shot was deflected by Zajac on the Devils' goal, had a good chance from the right circle with six minutes to play. Jamie Langenbrunner, who was stoned in close early in the game, was stopped in close again seconds later.
Zajac and Zubrus were stopped in close in the final minutes.
The Islanders had a two-man advantage when Guerin gave them the lead with less than five minutes to go in the first period. Colin White and Mike Mottau were both given 2-minute penalties at the same time.
Mike Comrie took a pass from Miroslav Satan low in the right circle and sent a cross-ice pass to Guerin low in the left circle. His quick shot went in and out of the net so fast that everyone kept playing other than Guerin.
Sillenger scored all alone in front in the second period after taking a great centering pass from behind the net by Trent Hunter.
Zajac scored at 7:11 of the final period, tipping a shot by Gionta. DiPietro got a piece of the puck, but it trickled between his pads and he seemed to knock it into the net.
RANGERS 2, SABRES 1
In New York, Petr Prucha and Brandon Dubinsky each had a goal and an assist to lift the New York Rangers to a victory that stretched Buffalo's losing streak to 10 games.
Buffalo snapped its run of three straight shootout losses, but still couldn't find a way to win. The Sabres haven't come out on top since a 6-5 shootout victory at Philadelphia on Dec. 22 (0-5-5).
The Rangers shook off Monday's poor 4-1 loss at Pittsburgh and earned their second consecutive win at home.