Scandella took a pass from Johan Larsson and beat goalie Jimmy Howard.
"Johan made a great play to get to the net, and I tried to find some space in the slot," Scandella said. "I saw the green light go off out of the corner of my eye, but I was pretty sure the puck was already in."
[WATCH: All Sabres vs. Red Wings highlights]
With Larsson in the penalty box, Red Wings forward Justin Abdelkader scored on the power play with 1:25 left in the third period to tie the game 2-2.
"There's a very thin line between a great finish to a game and a terrible one," Larsson said. "I hated watching them tie it from the box, so it was nice to make a play in overtime."
Evander Kane scored his 20th goal, and Rasmus Ristolainen had a goal and an assist for the Sabres (18-32-11), who ended a three-game losing streak (0-2-1).
Video: BUF@DET: Ristolainen scores on deflected point shot
"I thought we did a very nice job, except for the start of the second period," Sabres coach Phil Housley said. "We sat back and let them use their speed, which we knew we couldn't do, but we pulled it back together."
Robin Lehner made 35 saves, including a point-blank pad save on defenseman Trevor Daley in overtime.
"The one thing about 3-on-3 is that you usually get a chance to get set for 2-on-1 breaks," Lehner said. "I knew where [Daley] was, and I knew [Andreas Athanasiou] was going to make the pass, so I got across."
Jonathan Ericsson scored for Detroit, which has lost four of its past five games (1-3-1). Howard made 27 saves.
Video: BUF@DET: Ericsson wires perfect wrister into the net
"We melted," Red Wings coach Jeff Blashill said. "They got an early goal, and it took our fight away. We can't let that happen."
The Red Wings (24-26-10) are seven points behind the Columbus Blue Jackets and New York Islanders for the second wild card into the Stanley Cup Playoffs from the Eastern Conference.
"This was a tough one," Detroit captain Henrik Zetterberg said. "We had chances to put the game away, and we didn't take them."
The Sabres took a 1-0 lead at 3:39 of the first period when Ristolainen's wrist shot from the point deflected off Ericsson and past Howard.
Buffalo nearly doubled its lead at 5:11, but Ericsson blocked Sam Reinhart's shot at an open net.
Ericsson tied it 1-1 at 3:42 of the second period when he put a wrist shot past Lehner's glove and inside the left post.
Kane gave the Sabres a 2-1 lead with a power-play goal at 13:09. He went around the net to beat Howard on a wraparound shot. Blashill challenged for goaltender interference, but the goal was upheld after video review.
Video: BUF@DET: Kane wraps one past Howard for a PPG
Red Wings forward Tomas Tatar hit the post at 18:30 of the second period with Detroit on the power play.
The Red Wings struggled to create chances in the third period, getting two shots on goal through 17:59.
Larsson took a tripping penalty with 2:56 remaining, and the Red Wings pulled Howard with 2:12 left for the extra attacker.
Lehner stopped Frans Nielsen's shot off a face-off, but the rebound trickled through his legs to Abdelkader, who knocked it in for the tying goal on Detroit's fourth shot of the power play, sixth of the period.
"It was a 6-on-4, so they were trying to tie everything up, but the puck came clean to [Nielsen] all alone in front," Abdelkader said. "He took the shot and I was just looking for a loose puck."
Goal of the game
Scandella's goal at 4:59 of overtime.
Video: BUF@DET: Scandella beats the clock for OT winner
Save of the game
Lehner stopping Daley at 3:16 of overtime.
Video: BUF@DET: Lehner robs Daley's backdoor chance in OT
Highlight of the game
Abdelkader's goal at 18:35 of the third period.
Video: BUF@DET: Abdelkader buries the game-tying goal late
They said it
"I understand the business, so I know why some teams sit guys out, but that's not what I want. I want to be playing with my team, no matter what might happen. I don't want to be watching." -- Sabres forward Evander Kane on playing with the NHL Trade Deadline approaching
"If he's healthy to play, he'll play. There's risk in playing him, but there's also risk in not playing him because there might be teams who want to see him." -- Red Wings coach Jeff Blashill on defenseman Mike Green, a subject of trade rumors who has missed four games with an upper-body injury
Need to know
Scandella was the second NHL player to score at 4:59 of overtime this season, joining Tyler Toffoli, who did it for the Los Angeles Kings in a 2-1 win against the Boston Bruins on Oct. 28. … The Red Wings are 2-8 in games decided in overtime this season.
Sabres: At the Washington Capitals on Saturday (7 p.m. ET; NBCSWA, MSG-B, NHL.TV)
Red Wings: Host the Carolina Hurricanes on Saturday (7 p.m. ET; FS-D, FS-CR, NHL.TV)
Video: Scandella, Sabres edge Red Wings in overtime, 3-2