Alex Killorn had a goal and an assist, Frank Vatrano and Leo Carlsson scored, and John Gibson made 24 saves for the Ducks (21-35-3), who ended a three-game skid. Jackson LaCombe and Ryan Strome each had two assists.
"It’s a rivalry game, it’s always fun to play those games," Anaheim defenseman Radko Gudas said. "They're a big, heavy team. I thought we played very physical as well."
Anthony Duclair had two goals and an assist, Mike Hoffman had a goal and an assist, and Mikael Granlund had three assists for the Sharks (15-38-5), who have lost five straight. Kaapo Kahkonen made 24 saves.
"I liked our game, I just didn't like the score," San Jose coach David Quinn said.
Duclair put the Sharks ahead 1-0 at 2:47 of the first period when Fabian Zetterlund set him up for a shot through traffic.
Carlsson tied it 1-1 at 3:07, tipping in a cross-ice pass from Killorn.
Brett Leason’s short-handed goal gave the Ducks a 2-1 lead at 4:37 after Pavel Mintyukov set him up for a wrist shot.