Sam Reinhart scored twice, and Brady Tkachuk got his first point for the Panthers (2-2-2), who have lost four of five (1-2-2).
Jacob Markstrom allowed two goals on 11 shots before exiting after the first period. Akira Schmid made 18 saves in relief.
Florida visits the Columbus Blue Jackets on Tuesday.
“He just tightened up, and so we pulled him,” Panthers coach Paul Maurice said. “We’ll see. There’s no injury there, we don’t think, that we can’t deal with. Just standard stuff.”
Ostlund gave the Sabres a 4-3 lead with a power-play goal at 7:15 of the third, when Zach Benson found him in front of the net for a quick one-timer.
Josh Doan’s first goal of the season put Buffalo in front 1-0 at 5:58 of the first. He received a pass from Krebs on the rush at Florida’s blue line and took it to the right circle, where he beat Markstrom with a wrist shot.
“I think a little bit of relief to just see something go in the net right now,” Doan said. “It was good to see and good to build off. I think after that we kind of got rolling a bit there, and it’s nice to see a couple of guys get on the score sheet tonight.”
Anton Lundell tied it 1-1 at 11:00. Ellis made a chest save but couldn’t contain the rebound, and Lundell won a puck battle low in the right circle and slipped it between Ellis’ pads.
Dahlin made it 2-1 on the power play at 15:55 with a one-timer from above the slot that got past Markstrom high to the blocker side.