DETROIT (AP) — Jack Quinn scored the only goal in a shootout, Dylan Cozens had the second two-goal game of his career and the Buffalo Sabres held off the Detroit Red Wings 5-4 on Wednesday night.

Mattias Samuelsson got his first career goal for the Sabres, who squandered a three-goal lead in the third period. Jeff Skinner supplied his sixth goal in five games on a power play, while Craig Anderson made 40 saves and collected an assist. Rasmus Dahlin added two assists.

Oskar Sundqvist scored twice during Detroit’s rally. Jonatan Berggren and David Perron also had goals for the Red Wings, and Alex Nedeljkovic stopped 30 shots.

Buffalo led 2-1 after the first period.

Berggren scored his second career goal off a pass from Filip Hronek, beating Anderson on the stick side.

Cozens knotted the score with a short-handed goal. Anderson whipped the puck from behind the the net around the boards and toward center ice. Cozens gathered it and got behind the defense.

Samuelsson’s first goal in 64 career games was a shot from the right side that bounced off Nedeljkovic’s arm and into the net.

Cozens scored from the slot at 8:12 of the second to make it 3-1.

Skinner scored just more than two minutes later on a wraparound move with Detroit defenseman and last season’s NHL Rookie of the Year Moritz Seider down on the ice. Seider, hit in the leg by Tage Thompson’s shot, returned to action later in the period.

Perron made it 4-2 early in the third and Sundqvist scored in front off Andrew Copp’s pass at 10:41.

Sundqvist tied it at 12:31 with a shot from the left circle after Copp won a faceoff.

Buffalo killed off three penalties, including a 5-on-3 for 1:27, in the last six minutes to force overtime.

NOTES: The Sabres are 6-1-4 against the Red Wings over the past 11 meetings. … Anderson, whose NHL career began during the 2002-03 season, has 20 career assists. … Perron has 21 points in 21 career games against Buffalo. … Cozens’ first multigoal game came against Edmonton last November.

UP NEXT

Sabres: Host Colorado on Thursday.

Red Wings: Host Vegas on Saturday.