Kris Letang and Marcus Pettersson each had a goal and an assist, and Sidney Crosby had two assists for the Penguins, who finished the preseason 3-3-1. Tristan Jarry made 33 saves.
Casey Mittelstadt had a goal and two assist for the Sabres, who went 3-4-0 in the preseason. Devon Levi made 29 saves.
O’Connor scored on a breakaway 20 seconds into the first period to give Pittsburgh a 1-0 lead.
Victor Olofsson tied it 1-1 at 9:46 after Jarry turned it over on a clearing attempt.
Zach Benson gave Buffalo a 2-1 lead at 2:06 of the second period, scoring on the rush. The No. 13 pick in the 2023 NHL Draft scored four goals in six preseason games.
JJ Peterka scored from the slot on the power play at 5:08 to give the Sabres a 3-1 lead, but Pettersson scored on the rush at 7:17 to pull the Penguins within 3-2.
Lars Eller tied it 3-3 at 8:42 when Ryan Graves’ shot deflected in off his leg.
O’Connor scored again at 9:31 to take a 4-3 lead, skating in alone on Levi.
Evgeni Malkin scored on the power play at 15:44 to make it 5-3, redirecting a pass from Erik Karlsson.
Jeff Carter scored off a scramble in front 1:33 into the third period to make it 6-3.
Mittelstadt cut it to 6-4 when he scored on a backhand at 6:38.
Letang scored a power-play goal at 15:13 for the 7-4 final.