Stafford's tally with less than 6 minutes remaining in the third period broke a 2-2 tie. He then helped out Nathan Gerbe on another Buffalo score 2 minutes later to seal the victory.
Ryan Miller earned the victory with 23 saves.
The Oilers lost for the fourth time in five games despite goals from Taylor Hall, Sam Gagner and Corey Potter.
Nikolai Khabibulin yielded four goals on 33 shots for Edmonton.
NBC reportedly holds celebs hostage to Jimmy Fallon's show
Aaron Carter is still in love with Hilary Duff