The shutout was Niemi's sixth of the season and improved his record to 32-17-6 for the Sharks, who got goals from Marc-Edouard Vlasic, Dan Boyle, Logan Couture and Ben Eager in their sixth win in seven games.
The win put San Jose four points ahead of Phoenix in the Pacific Division and landed the Sharks in the playoffs for a seventh consecutive season.
Kari Lehtonen gave up four goals on 33 shots for the Star before giving way to Andrew Raycroft, who allowed two more goals in Dallas' fifth straight loss -- and seventh in eight games.
The Stars are tied with Calgary for ninth place in the Western Conference, three points behind the Blackhawks.
Chipotle plans first price increase in 3 years
Putin thinks Obama would save him if he were drowning