Compher put Detroit ahead 3-2 with a power-play goal at 14:26 of the third period. Erik Gustafsson's point shot hit the post and Alex Nedeljkovic's back, then slid toward the line. Compher was the first to react and pushed it in.
Compher and Jonatan Berggren each had a goal and an assist for the Red Wings (15-18-4), who are 2-1-0 under new coach Todd McLellan. Alex Lyon made 23 saves.
Drew O'Connor scored both goals for Pittsburgh (17-17-5) -- his first two-goal game since getting the second and third goals of his NHL career in a 7-1 win over the Toronto Maple Leafs on Oct. 23, 2021.
Alex Nedeljkovic made 21 saves against his former team.
Berggren gave the Red Wings a 1-0 lead at 7:52 of the first period, taking a pass from Vladimir Tarasenko and beating Nedeljkovic on a breakaway.
O'Connor made it 1-1 at 18:29, one-timing Cody Glass' pass in off the toe of Lyon's skate.
Kane made it 2-1 Detroit with a power-play goal at 3:41 of the second period, beating Nedeljkovic from the right face-off circle off Alex DeBrincat's pass. It was the 125th goal where Kane or DeBrincat got an assist on the other's goal.
The Penguins nearly tied the game in the last minute of the second period, but Moritz Seider blocked Anthony Beauvillier's shot on the goal line with Lyon out of position.
O'Connor got his second of the game to make it 2-2 at 3:18 of the third period. He jammed home a loose puck in the crease for a power-play goal.
After Compher gave Detroit the lead, Dylan Larkin scored into the empty net for the 4-2 final at 19:46.