Alex DeBrincat had a goal and two assists, Patrick Kane had a goal and an assist, and Moritz Seider had two assists for the Red Wings (39-25-8), who had lost two straight.
Detroit moved one point back of the New York Islanders, who have played one more game, for the second wild card into the Stanley Cup Playoffs from the East.
Tage Thompson and Rasmus Dahlin scored, and Alex Lyon made 15 saves for the Sabres (44-21-8), who have lost three in a row (0-1-2) for the first time since Dec. 3-8 (0-3-0).
Buffalo remained two points ahead of the Tampa Bay Lightning, who have a game in hand, for first in the Atlantic Division.
DeBrincat gave Detroit a 1-0 lead on a power play at 4:02 of the first period. He chipped the puck over Lyon's left pad after he deflected Seider's shot from the point.
Lucas Raymond made it 2-0 at 9:11 with another goal on the man-advantage. Seider gloved down Ryan McLeod's clearing attempt at the right point and passed across to Raymond, who skated it to the left face-off dot before scoring with a wrist shot that beat Lyon glove side.
Marco Kasper extended the lead to 3-0 at 16:06 of the first. Emmitt Finnie was denied twice by Lyon from point-blank range, but he got his third rebound back and passed to Kasper, who spun around in the right circle for a quick wrist shot short side.
Thompson cut it to 3-1 at 5:35 of the second period when he beat Gibson five-hole with a one-timer from the top of the left circle off a cross-ice feed from Peyton Krebs.
Jacob Bernard-Docker made it 4-1 at 15:46 of the third period, scoring his first goal of the season from the top of the left circle.
Dahlin quickly answered back for the Sabres at 16:25. Bowen Byram's one-timer from the point was blocked in front, but Dahlin found the loose puck and scored with a shot that just trickled over the goal line off the glove arm of Gibson to make it 4-2.
Kane scored an empty-net goal at 18:17 for the 5-2 final.