Stajan scored his fifth goal of the season on a one-timer off an assist by Blake Comeau with 40 seconds to go in overtime and give the Flames their 78th point of the season.
The Flames and the Sharks are tied for the eighth playoff slot in the Western Conference.
Logan Couture scored both San Jose goals. Antti Niemi allowed three goals on 22 shots for the Sharks, who fell for the sixth time in their last seven games.
Susan Sarandon 'very excited' about daughter's pregnancy
Jessica Simpson shares three-way kiss with friends in photo