Niemi made nine saves in the third period to help the Sharks hang on for their fifth win in six games.
Patrick Elias got the Devils' only goal on a third-period power play.
Martin Brodeur made 28 saves for New Jersey, which wrapped up a three-game California road trip with a 2-1-0 mark.
Easer Egg Roll brings thousands to White House
Yosemite climber falls 30 feet, suffers major injuries