JJ Peterka and Peyton Krebs scored for the Sabres (34-33-5), who had lost two straight and three of four before closing out a season-long five-game road trip with a victory. Ukko-Pekka Luukkonen made 32 saves.
"It's been a tough trip," Thompson said. "I thought we played some really good hockey, and obviously we had some stretches where not good enough, not happy. It's good to head home with a win under our belt and kind of keep that momentum going into our next one."
Buffalo is six points back of the Washington Capitals, who have two games in hand, for the second wild card into the Stanley Cup Playoffs from the Eastern Conference.
"I think one game at a time," Thompson said. "Can't look too far ahead. In order to get there, we've got to take care of the next game. We have a short-term mindset, a short memory. Obviously, with this win it feels good, but we've got to make sure we're ready for the puck drop on our next game as well."
Jonathan Huberdeau scored, and Dustin Wolf made 25 saves for the Flames (33-32-5), who have lost three straight and six of eight, including 4-2 at the Vancouver Canucks on Saturday.
Calgary is 12 points behind the Vegas Golden Knights for the second wild card from the West.
"We can only control our own games and what's going to happen," Flames captain Mikael Backlund said. "Losing two games, teams winning, it makes the playoff hopes smaller of course. We all know that. But at the end of the day, you have to go out there and work hard every day and enjoy whatever's left of this year, and we'll see where it takes us."