Jason Demers also scored for the Sharks, who rebounded from back-to-back losses at Anaheim and Phoenix to close within one point of Pacific Division-leading Los Angeles and Phoenix with three games remaining.
The Stars were thoroughly outplayed for a second straight night and have gone from leading the Pacific Division heading into Friday's 5-2 loss at Vancouver to being out of the playoff picture one night later. Dallas trails eighth-place San Jose by one point for the final postseason spot and is two points out of the division lead.
The Stars dropped to 1-11-2 in the back end of back-to-backs but can get back into playoff position when these teams meet in a rematch in Dallas on Tuesday night. To do it, they will have to play much better than they did in San Jose when they lost for the fourth time in five games to the Sharks this season.
San Jose got a goal in the opening minute of the game, a second late in the first period and never looked back. Pavelski put the Sharks firmly in control when he tipped Marc-Edouard Vlasic's point shot past Kari Lehtonen midway through the second period to make it 3-0.
Niemi did the rest, making 22 saves for his 19th career shutout. The Sharks won all three home games against Dallas, outscoring the Stars 13-4 in the contests. They have won just five of 16 games against the rest of the division, a major reason why they are in danger of missing the playoffs for the first time since 2002-03.
San Jose has a home-and-home against Los Angeles after the trip to Dallas and might need to win two of those remaining three games to make it back to the postseason.
After being held to just one goal in the back-to-back losses at Anaheim and Phoenix, the Sharks got off to a fast start in front of a boisterous home crowd. Just 58 seconds into the game, Joe Thornton found Pavelski coming down the slot with a perfect feed and Pavelski one-timed it past Lehtonen.
Both teams had good chances for a second goal with Michael Ryder's attempt at an open net for Dallas deflecting off defenseman Justin Braun's stick and into the crowd, and Patrick Marleau hitting the post for San Jose.
But San Jose finally converted on its third power play of the period when Marty Havlat delivered a pinpoint pass to Demers, who came in from the point on the backside and knocked in his third goal of the season with 1:22 left in the first.
Notes: San Jose F Logan Couture has matched a career-long drought by going 10 games without a goal. ... Thornton has 11 points in five games against Dallas this season. ... Sharks D Douglas Murray missed his second straight game with a lower-body injury. ... Dallas D Mark Fistric returned after missing five games with an abdominal strain and C Toby Petersen played after being a healthy scratch for 15 straight games. C Tom Wandell sat out again with an illness.