Lapierre pulled Washington to within 2-1 at 2:09 of the second period, tapping in a pass from Alex Ovechkin, but Joe Veleno scored from the high slot following a turnover to put Detroit ahead 3-1 at 4:44.
Gostisbehere pushed it to 4-1 at 9:01, beating Lindgren from the high slot.
Sgarbossa cut it to 4-2 at 16:38, burying a rebound off the end boards past Lyon for his second goal.
Compher responded with a short-handed goal to make it 5-2 at 19:47.
“They had the puck lying on our goal line, so it probably should have been 4-3, and then we make a play and get the huge short-handed goal,” Lalonde said. “That was great for J.T. He does so much for us that you like to see him get rewarded.”
Robby Fabbri scored on the power play to give the Red Wings a 6-2 lead at 4:31 of the third period.
Pacioretty scored his own power-play goal to make it 6-3 at 7:09, but Alex DeBrincat scored on a 3-on-2 rush to extend it to 7-3 at 11:49.