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.
Trader Joe's: Car crashes into Long Island store, injuring 11
'SNL': 'Anchorman 2' cast, One Direction sing 'Afternoon Delight' [VIDEO]