Jonathan Bernier made 37 saves for Detroit (6-13-3), which split a two-game set against Nashville after a 2-0 loss Tuesday.
"We've struggled to put the puck in the net this season and we've had to battle some adversity, so tonight was huge," Red Wings forward Luke Glendening said. "When we did have some breakdowns, [Bernier] was huge. He's been great for us all season."
Mikael Granlund and Erik Haula scored for Nashville (8-11-0), which lost for the first time in three games.
"This one hurts," Haula said. "We've been playing better as a group, got a couple wins, and it felt like we were trending in the right direction before tonight."
Glendening gave the Red Wings a 1-0 lead at 4:55 of the first period when he backhanded a rebound past goalie Pekka Rinne from one knee.
Granlund tied it 1-1 at 14:15 with the Predators' third power-play goal of the two-game set. He took a pass from Roman Josi at the edge of the crease and tucked in his own rebound after Bernier made the initial save.
Gagner put Detroit ahead 2-1 at 8:38 of the second period, bouncing the puck in off Rinne from behind the goal line for his first goal in 18 games dating to Feb. 29, 2020.
Haula tied it 2-2 at 2:55 of the third period, batting the puck in off the crossbar for his first goal of the season.