It was the preseason opener for each team. The Sharks used a split squad.
Kodie Curran put the Ducks ahead 4-3 at 12:03 of the third, Troy Terry scored a power-play goal at 15:32, and Greg Pateryn scored into an empty net at 18:23 after Rudolfs Balcers tied it 3-3 for the Sharks at 6:35.
Curran, Terry and Alexander Volkov each had a goal and an assist, and Sonny Milano had two assists for Anaheim.
Balcers and Nick Bonino each had a goal and an assist for San Jose.
Hampus Lindholm gave the Ducks a 1-0 lead at 5:30 of the first period.
Bonino, in his Sharks debut, tied it 1-1 on the power play at 14:53.
Volkov put Anaheim ahead 2-1 at 1:39 of the second period before Tristen Robins tied it 2-2 at 10:24.
Benoit-Olivier Groulx gave the Ducks a 3-2 lead at 15:36.
Lukas Dostal saved 13 of 14 shots for Anaheim, and Olle Eriksson Ek allowed two goals on 13 shots.
Alexei Melnichuk saved eight of 10 shots for San Jose, and Zach Sawchenko made 14 saves.