Jonathan Cheechoo scored the tying goal with 7:14 left for the Sharks, who capped a thrilling meeting between two of the league's top three teams with a third-period rally that snapped Anaheim's seven-game road winning streak in the Ducks' first of four visits to the Shark Tank this season.
Mark Smith and captain Patrick Marleau scored 2:49 apart in the second period to erase a 2-0 deficit for the Sharks, who avenged a 5-0 thrashing in Anaheim in the clubs' first meeting last month. Evgeni Nabokov made 32 saves in his fifth victory in six starts.
Ryan Getzlaf and Corey Perry scored early goals for the Ducks, who finished a five-game road trip with just their second road loss in regulation all season.
After Dustin Penner and Cheechoo traded goals 31 seconds apart in the third, Jean-Sebastien Giguere had no chance when Thornton aggressively charged the net and bounced a power-play shot off the leg of Niedermayer while the Anaheim captain checked Cheechoo.