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.
Putin thinks Obama would save him if he were drowning
Justin Bieber crashes Drake Bell's album release party