With 6 1/2 minutes left in a tie game, Souray collected the puck at the left point and unleashed a shot that was deflected by the stick of San Jose's Scott Gomez and went past Thomas Greiss for the decisive tally.
The game-winner came less than 10 minutes after the Ducks' Saku Koivu scored an unassisted goal thanks to fortunate bounce off the backboards to produce a 1-1 tie.
Viktor Fasth turned aside 21-of-22 shots for Anaheim, which won its fourth straight at home and improved to 6-1-1 on the season before embarking on a six-game road trip.
Logan Couture found the net and Greiss finished with 31 stops for the Pacific Division-leading Sharks, who came into the contest with a 7-0-1 mark.
2014 amfAR Inspiration Gala [PHOTOS]
Julius Randle breaks leg during NBA debut