Cedric Paquette scored off a drop pass from Mikhail Sergachev on the rush to give the Lightning a 5-4 lead with 5:41 remaining in the third period.
It was the fifth lead change of the game.
[WATCH: All Sabres vs. Lightning highlights]
"It's a great feeling to see that shot go in against a team like that," Paquette said. "It was a playoff atmosphere. They were playing hard, they won 10 straight, and we really wanted the challenge."
Video: BUF@TBL: Paquette nets go-ahead goal in 3rd
Dan Girardi, Alex Killorn, Nikita Kucherov and Steven Stamkos scored for the Lightning (18-7-1), who have won four of five games and moved past the Sabres (17-7-2) for first place in the Atlantic Division. Louis Domingue made 18 saves.
Sam Reinhart scored two goals for the Sabres, who lost for the first time since Nov. 4. Carter Hutton made 32 saves.
"I thought it was a great stretch by us, 10 games in a row is pretty good," said Buffalo captain Jack Eichel, who had two assists. "It shows us we can win every night we go out there, and that should be our mindset."
Tage Thompson gave the Sabres a 4-3 lead at 2:29 of the third period with a shot that beat Domingue to the far post.
Stamkos tied it 4-4 at 4:12 on the power play on a one-timer off a pass from Victor Hedman.
Video: BUF@TBL: Stamkos strikes quickly on power play
"Our penalty kill was solid, great double-minor penalty kill in the second," Buffalo coach Phil Housley said, referring to the high-sticking call against Johan Larsson at 11:45. "But when you get into those penalty situations, it disrupts our bench and the flow of our lines."
The Sabres and Lightning combined for five goals in the first period.
Girardi gave Tampa Bay a 1-0 lead at 2:59 when he followed up his own shot after Killorn set up him up in the low slot.
"I thought it was a really good first period, really physical and in each other's faces," Girardi said. "On the goal, somehow I got down there and no one covers me. [Killorn] made a great play and gave me a good look."
Zemgus Girgensons tied it 1-1 at 8:42 when he tipped a Rasmus Ristolainen shot.
Reinhart gave Buffalo a 2-1 lead at 9:45 with a shot that bounced off Domingue's shoulder.
"When you go on a streak like that, teams are going to take notice and be ready for you and they certainly were tonight," Reinhart said. "We have another opportunity, another crack at it to get two more points tomorrow."
Killorn tied it 2-2 at 10:28 when he put in the rebound of a J.T. Miller shot.
Video: BUF@TBL: Killorn hammers home loose puck
"Both teams coughed up leads," Tampa Bay coach Jon Cooper said. "There were a ton of swings in this game, and I'm pretty sure if you're a fan of hockey and in the building tonight, you enjoyed this game."
Kucherov put the Lightning ahead 3-2 at 15:55 when he shot into the left corner from the slot on a rush. He has 17 points (three goals, 14 assists) during an eight-game point streak.
"It was a 3-on-1, and I decided to shoot the puck," Kucherov said. "That's it."
Reinhart scored his second goal of the game to tie it 3-3 at 5:39 of the second period when Eichel's shot deflected off his skate.
Lightning defenseman Ryan McDonagh left the game at 11:50 of the first period after he was checked from behind into the end boards by Eichel, who received a minor penalty for boarding. Cooper said there would be an update on McDonagh's injury Friday.
They said it
"That game could have gone either way. I wish we had those guys again, but we don't. It's an emotional game, but we have to make sure we're ready for tomorrow too." -- Sabres forward Kyle Okposo
"It was great to see [Cedric Paquette] get that winner. I thought he had an outstanding game tonight. That line was great, and they got rewarded for it in the end." -- Lightning coach Jon Cooper on the line of Paquette, Ondrej Palat and Ryan Callahan
Need to know
Sabres defenseman Jake McCabe left the game with an undisclosed injury at 5:13 of the second period. Housley said he would have an update Friday. ... Sabres defenseman Nathan Beaulieu, playing his 300th NHL game, was assessed a 10-minute misconduct penalty at the end of the first period. ...Kucherov had 23 points (five goals, 18 assists) in 15 games in November. ... Sabres forward Jeff Skinner's five-game point streak ended. ... Eichel has 11 points (one goal, 10 assists) in the past eight games. ...Lightning center Brayden Point, who set up Kucherov's goal, has seven points (four goals, three assists) in his four-game point streak. ... Hutton won his previous eight games (seven starts).
Sabres: At the Florida Panthers on Friday (7 p.m. ET; SNE, SNO, SNP, FS-F, MSG-B, NHL.TV)
Lightning: At the Florida Panthers on Saturday (7 p.m. ET; FS-F, SUN, NHL.TV)
Video: Paquette's goal helps Lightning snap Sabres' streak