Thomas Vanek also scored twice, while Cody McCormick ended with a goal and two helpers as the Sabres rebounded from Tuesday's overtime loss in Boston. Ryan Miller made 26 saves in the victory.
Logan Couture had a goal and an assist for the Sharks, who ended their road trip at 3-2. Antti Niemi allowed five goals on 36 shots.
Buffalo took control by scoring the first three goals.
Gaustad got the Sabres on the board 12:18 into the first period, just after a left-circle faceoff in the Buffalo offensive zone. Gaustad immediately fired a shot that caromed off Sharks defenseman Dan Boyle, fooling Niemi before fluttering into the net.
Another faceoff win allowed Buffalo to take a 2-0 lead. The Sabres kept the puck in the zone and were unsuccessful on a few shots before Vanek's slapper from the high slot beat Niemi at 6:48 of the middle stanza.
Later in the second, San Jose was on the power play when Pominville swiped the puck from Sharks defensemanJason Demers at the right point. Pominville raced to the other end of the ice and fired a long wrister into the net.
The Sharks got back in the game by scoring twice before the period was through. Couture's power-play tally with 4:10 left and Marc-Edouard Vlasic's wrister in the final minute had San Jose within 3-2 moving to the third.
However, McCormick restored Buffalo's two-goal edge only 31 seconds into the final period.
Douglas Murray scored for the Sharks' nearly midway through the period, but that was the only goal Miller gave up in the frame on nine shots. In the final minute, Gaustad's empty-netter and Vanek's second goal provided some cushion.
The home team is 19-2-4 in the last 25 meetings between the teams...San Jose hosts Chicago and Dallas before heading back out on the road for three games...Buffalo hosts Pittsburgh on Saturday.