Smith nearly got a second goal later in the period, but Gibson stopped him on a breakaway at 12:59.
The Sharks took a 2-1 lead at 1:58 of the second period. Nick Leddy backhanded a pass toward the front of the crease, and Graf tipped it past Gibson.
Detroit pulled even at 2-2 when Compher put in Kasper’s pass on the rush at 6:55. Kasper intercepted John Klingberg’s pass in the neutral zone, then drove past the defenseman at the blue line before feeding Compher.
“I thought (Michael) Misa was coming up on the boards, so I was going to give him the puck,” Klingberg said. “I tried to pinch in and get it back, but I ended up on the outside and he beat me on the inside.”
Larkin put the Red Wings ahead 3-2 at 4:41 of the third, jamming the puck in at the left post as Askarov tried to cover it.
Gibson made 11 saves in the period, including a big stop on Celebrini’s slap shot from low in the right circle at 13:35, one second after a Sharks power play expired.
Kasper then scored into an empty net at 18:28 to make it a 4-2 final.
“It’s always fun to score one, especially after a long time,” Kasper said. “It was an empty-net goal, but they count the same, so I’ll take it.”
NOTES: DeBrincat reached 25 goals for an eighth season, tied with Kyle Connor for the third most by an active United States-born player, behind Patrick Kane (11) and Auston Matthews (nine). … Detroit has multiple 50-point scorers prior to its 50th game in a season for the first time since 2007-08 (Henrik Zetterberg and Pavel Datsyuk). It won the Stanley Cup that season. … Larkin’s goal was the 266th of his career, moving him past John Ogrodnick for 10th place in Red Wings history.