Kyle Okposo scored his 20th of the season, Tage Thompson had the game-winning goal, and Craig Anderson made 18 saves for the Sabres (28-38-11), who have won two of three.
"The first period we were emotional and frustrated, so [coach] Don [Granato] was talking a lot about how we have to come back and not be emotional," Dahlin said. "We have to use our emotion to our advantage, so that's what we did and [played] a great second period. We came back and battled [in] the third so it was a good game."
Joel Farabee, Owen Tippett and Travis Konecny scored, and Martin Jones made 25 saves for the Flyers (23-41-11), who have lost nine of 11.
"We didn't play well enough, that's the bottom line, [in] a number of different areas," Philadelphia coach Mike Yeo said. "I think you saw our execution, the number of missed passes, the decision-making at different times. I also felt we played it very easy, tried to play an easy game. A lot of poke-and-hope and swinging in our game, and against a team that has an awful lot of skill in their lineup."