Thornton, 39, hadn't had a three-goal game since Oct. 27, 2010, when he had a five-point night in a 5-2 victory over theNew Jersey Devils.
This time, he did the trick against the Bruins, the team that drafted him No. 1 overall in 1997, then traded him to San Jose in November 2005.
It looked like it was going to be the fitting capper of a great Sharks comeback from a 3-0 first-period deficit, as Thornton gave the Sharks a 5-4 lead with 6:28 left to play in the third period.
But a late goal by Boston's Chris Wagner and the overtime game winner by Bruins defenseman Charlie McAvoy dampened Thornton's celebration.
Thornton had reconstructive knee surgery each of the past two offseasons, which has limited his contributions and left him as the Sharks' third-line center.
The hat trick was the fifth of Thornton's career -- three as a Shark, two as a Bruin -- and made him the oldest player to have a three-goal game since Jaromir Jagr did so four seasons ago at 42.
Thornton, a likely future Hall of Famer, is 15th all time in points in the NHL.
Thornton nets hat trick in loss to Bruins
Joe Thornton records his first hat trick since 2010 in San Jose's 6-5 loss to Boston.