Byram, who opened the scoring in the first period and had an assist, one-timed a cross-slot pass from Ryan McLeod, beating Senators goalie Linus Ullmark blocker side for the game-winning goal.
Noah Ostlund also scored and Alex Lyon made 24 saves for the Sabres (18-14-4), who are 8-2-1 against Ottawa in their past 11 meetings.
Tim Stutzle scored to extend his point streak to eight games, Ridly Greig scored and Linus Ullmark made 22 saves for the Senators (18-13-5), who had won four straight.
Byram gave the Sabres a 1-0 lead at 15:22 of the first period. Byram snuck in from the blue line and scored on a long seam pass from Jordan Greenway.
Greig elected to drive the net on a 2-on-1 rush and finished a deke on the backhand over Lyon’s glove to tie it 1-1 at 17:13.
Ostlund tipped a Byram wrister tailor-made for a deflection to give Buffalo a 2-1 lead at 6:11 of the second period.
Stutzle tied it 2-2 at 9:27. Drake Batherson, from his knees, found Stutzle alone in the slot with a centering pass, and Stutzle beat Lyon glove side with a wrist shot on a power play. Stutzle has 15 points (seven goals, eight assists) during his point streak.
Lyon, sprawled out on the ice, robbed Batherson with the glove to keep it 2-2 at 17:55 of the third period.