The long and dramatic shootout included goals by both teams in the fourth and fifth rounds. After two misses for each side, Thornton came through against Ben Scrivens and Tyler Toffoli then turned up empty against Antti Niemi.
Thornton also scored in the second period, as did teammate Joe Pavelski, to give the Sharks the lead heading into the final frame.
Drew Doughty created a 2-2 tie 6:23 into the third.
Both Scrivens and Niemi turned aside 38 shots during regulation and overtime.
The Sharks won their third in a row and captured their second shootout victory of the season.