The Red Wings killed the second penalty, but Zemgus Girgensons put the Sabres up 4-2 at 1:33 of the second period.
Alex Chiasson brought Detroit within 4-3 with a power-play goal at 14:04, and rookie Simon Edvinsson tied it 4-4 at 16:52 with his second NHL goal.
Jordan Greenway put the Sabres up 5-4 at 3:20 of the third period, and Cozens made it 6-4 at 4:32.
"We couldn't keep the puck out of our net, but we hung in there," Red Wings coach Derek Lalonde said. "That's a really good point, [but] I think we probably deserved both of them."
Husso stopped Power at point-blank range in overtime, and Levi made a pad save on Berggren with five seconds left.
"We had the puck for most of the overtime, but I knew they were going to get one good chance," Levi said. "[Berggren] got the breakaway, but our defense moved him over to one side, so I could seal the post and get my pad on it."
Levi, playing his third NHL game, was facing 3-on-3 overtime and the shootout for the first time.
"I don't scout shootouts, because as soon as you start expecting someone to make a certain move, you're going to get caught by something else," he said. "It was pretty crazy to stop Dylan Larkin 1-on-1 to win my first one."
NOTES: Buffalo went 4-0-0 against Detroit this season, outscoring them 24-16. Thompson had nine points (four goals, five assists), and Cozens had seven (five goals, two assists). … Larkin's goal was his 32nd, matching his NHL career high from 2018-19. His 46 assists are one short of his total from 2017-18, and he is two points shy of reaching 80 for the first time.