"We need to figure out something real quick," Red Wings forward Anthony Mantha said. "It's embarrassing to lose that much. We need to start playing a good game and having pride in playing."
Perry gave the Ducks a 3-2 lead at 16:42 of the second period.
Rickard Rakell shot into traffic and the rebound came to Ryan Getzlaf, who made a no-look, backhand pass to Perry coming around the back of the net, and he tapped the puck across the goal line.
Nyquist tied it at 2-2 at 7:10 of the second period.
Henrik Zetterberg partially whiffed on a pass from behind the net, but it still got to Justin Abdelkader, who made another short pass to Nyquist skating down the slot. He beat Gibson for his 19th goal of the season.
"These are tough games when you're playing a hockey club that's playing loose and free," Carlyle said.
Anaheim went ahead 2-1 at 2:48 of the second when Grant shot a rebound into Howard's stomach, but his upper body was across the goal line after he'd been knocked over by teammate Jonathan Ericsson.
"We had issues in our own end," Zetterberg said. "When we are in our own end, we try and do the right things, but it gets hard for us sometimes."
Kesler backhanded his own rebound high in the net to make it 4-2 at 5:04 of the third period. All four lines contributed a goal for Anaheim.
"When we're engaged to that level, we're a very dangerous team," Carlyle said.
Ritchie gave the Ducks a 1-0 lead at 6:02 of the first period.