Sidney Crosby scored two power-play goals and had an assist for the Penguins.
Buffalo improved to 3-2-0 and Pittsburgh fell to 1-2-2 in the preseason.
Pittsburgh's Evgeni Malkin had an apparent tying-goal waved off when referees ruled that time had expired.
Buffalo's Thomas Vanek opened the scoring with his second goal of the preseason 1:26 into the first period.
Buffalo goaltender Jocelyn Thibault stopped Malkin on a penalty-shot attempt at 3:46. Thibault spent the past two seasons in Pittsburgh before signing with the Sabres this summer to back up Ryan Miller.
The Sabres extended their lead to 2-0 on defenseman Brian Campbell goal at 12:50.
Crosby brought the Penguins to 2-1 at 15:34 when he converted a bad bounce off Thibault following Malkin's attempted pass into his second preseason goal.
Jordan Staal scored his first goal of the preseason at 5:37 of the second period, cramming home a feed from left wing Mark Recchi to pull Pittsburgh even, 2-2. Crosby was credited with a secondary assist.
Crosby put the Penguins ahead, 3-2, at 5:37 of the second with his second power-play goal. Buffalo defenseman Hernik Tallinder answered barely over a minute later to tie the score.
Ryan Malone beat Thibault at 2:32 of the third period for his second goal of the preseason to give the Penguins a 4-3 lead. However, Buffalo tied the score at 4-all at 6:19 when center Roy scored his fourth exhibition goal.
Erik Christensen, who tied for the NHL lead with eight shootout goals last season, beat Thibault on a breakaway at 8:59 of the third period to give the Penguins a brief advantage at 5-4. Buffalo's Marek Zagrapen evened the score at 16:35.