Second-period tallies from Peter Holland, Emerson Etem and Ryan Getzlaff handed the Ducks a seemingly comfortable 4-1 lead, but the Sharks fought back.
Patrick Marleau tallied with 29 seconds left in the middle frame and Matt Irwin cut San Jose's deficit to one with a marker early in the third.
Beauchemin, however, secured the Pacific Division-leading Ducks' sixth win in seven games overall on an empty-netter with 46 seconds remaining.
Etem and Getzlaff each added an assist and Viktor Fasth earned the victory with 32 saves.
Jason Demers found the net and Antti Niemi turned aside 23 shots for the reeling Sharks, who lost for the sixth time in seven contests.
Beyonce flaunts bikini body, Blue Ivy in vacation pics
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'