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.
NBC reportedly holds celebs hostage to Jimmy Fallon's show
Ray Liotta sues skin care company over use of likeness