Perron gave Detroit a 4-3 lead at 4:05 of the third period, but Josh Archibald tied it 4-4 at 5:26 on a wraparound.
Perron's power-play goal from low in the left face-off circle put the Red Wings ahead 5-4 at 16:20, and he completed his eighth NHL hat trick by lifting a backhand over DeSmith's arm to make it 6-4 at 17:05.
DeSmith blamed himself for Perron's go-ahead goal.
"I overslid and he snuck one through the five-hole," he said. "That's one I have to have -- it's a huge letdown in that moment."
Larkin scored into an empty net at 19:23 for the 7-4 final. It was his third point of the period.
Nedeljkovic, who was recalled from the American Hockey League on Thursday, stopped 15 of 16 shots in the third.
"That was awesome to see," Larkin said. "He's had a tough road, but he's never complained. He's just done whatever he was asked and he went down and worked hard in Grand Rapids. I think everyone is happy for him."
NOTES: Perron became the first Red Wings player with three goals in a third period since Henrik Zetterberg did it in a 6-4 win against the Buffalo Sabres on Jan. 18, 2015. … Seider, Jordan Oesterle and Pius Suter each had two assists for Detroit. ... Evgeni Malkin had two assists for Pittsburgh.