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.
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'
Kate Middleton recycles dress at movie premiere