T.J. Oshie had a goal and an assist, and Evgeny Kuznetsov had three assists for Washington (19-4-5), which won its third game in a row. Ilya Samsonov, starting for the first time since Nov. 15, made 25 saves.
Robby Fabbri and Luke Glendening scored, and Jonathan Bernier made 29 saves for Detroit (7-19-3), which is winless in its past nine (0-7-2).
"I thought it was a solid game from us, especially after [losing 6-1 at the Philadelphia Flyers on Friday]," Red Wings center Dylan Larkin said. "We have to score goals. You can't wait until the last minute."
The Red Wings have been outscored 24-4 in their past five games.
"It's already snowballed a bit -- obviously we've had a long stretch here without winning a hockey game -- but we have to focus of the reality of how we have played," Detroit coach Jeff Blashill said. "You have to fight through the emotions and tell them what they are doing right and what they are doing wrong."
The Red Wings took a 1-0 lead on Fabbri's power-play goal at 11:47 of the first period. It was Detroit's first goal with the man-advantage in nine games; the Red Wings hadn't scored on their previous 19 power plays before Fabbri's goal.
Oshie tied it 1-1 at 2:19 of the second period with a power-play goal off Jakub Vrana's pass.
Ovechkin made it 2-1 at 9:21, circling the Red Wings net before beating Bernier from a sharp angle.
"I got lucky on that one, because I should have gone to my backhand," Ovechkin said. "Once I went behind the net, I just wanted to get to the other side and get a shot off. Luckily, it hit [Bernier] and went in."
Tom Wilson made it 3-1 at 14:23 of the third period, taking a pass from Ovechkin and putting a backhand between Bernier's pads, but Glendening pulled Detroit within 3-2 nine seconds later at 14:32.
"We felt a goal coming even before Wilson scored, and it was huge to go right out and get one on the next shift," Larkin said. "But we have to be able to follow that up for the rest of the game."
Ovechkin scored into an empty net to extend the lead to 4-2 at 18:25, then completed the hat trick with another empty-net goal with 55 seconds remaining for the 5-2 final.
"This was one of those games where we just wanted to be patient, bottle things up and try to score when we got chances," Kuznetsov said. "Maybe it wasn't our best game, but those two points are huge."