Tomas Nosek and Jon Merrill scored for Vegas (27-16-4), which had a 10-game point streak. Marc-Andre Fleury made 24 saves.
"I liked our game," Golden Knights coach Gerard Gallant said. "We played good hockey, we had lots of opportunities and they got a couple of breaks. They worked hard, they played a good, structured game. They got three, we got two, but I thought we battled hard and played pretty well.
"We made a couple of mistakes and it cost us goals, but overall, I thought we played a pretty good game."
WATCH: [All Sharks vs. Golden Knights highlights]
Melker Karlsson and Joonas Donskoi scored 39 seconds apart in the third period, and Martin Jones made 36 saves for San Jose (26-13-7), which has won five in a row.
It was the 1,000th regular-season victory in Sharks history.
"It's great," Sharks coach Peter DeBoer said. "Obviously working for the Sharks, the franchise and the area, but particularly for me it's a testament to the fans. They were Vegas and this environment before Vegas was this environment. It's a great place to work and it's a great place for our guys to play hockey."