TORONTO -- Alexey Marchenko scored against his former team to help the Toronto Maple Leafs end a season-high five game losing streak with a 3-2 win against the Detroit Red Wings at Air Canada Centre on Tuesday.
"Any time you're struggling, usually the first one you win isn't that pretty anyway," Maple Leafs coach Mike Babcock said. "So it was pretty early but it wasn't that pretty late."
Frederik Andersen made 22 saves for Toronto (29-22-14), which led 3-0 late in the second period.
Detroit (25-28-11) has lost three in a row.
WATCH: All Red Wings vs. Maple Leafs highlights
Red Wings forward Gustav Nyquist scored twice in 1:14, split by the second intermission, to force the Maple Leafs to defend a one-goal lead for most of the third period.
Nyquist got behind Toronto's defense and took a pass from Henrik Zetterberg before putting a backhand past Andersen to make it 3-1 with 38 seconds left in the second period. He made it 3-2 when he scored 36 seconds into the third.
"I've got all these great things I say but none of them seem to work. The reality is, you're 3-2 at home, play the game," Babcock said. "When you're loose and driving, you're flying and you're on top of the other team and you look fast and you're playing right. When you're tight, you look slow, and that's just [the] reality of being in the League and learning how to win."
Video: DET@TOR: Kadri roofs a wrister by Mrazek to pad lead
Marchenko, who was claimed by Toronto on Feb. 4 after being waived by Detroit, scored his first goal of the season at 1:07 to put the Maple Leafs up 1-0. The Red Wings challenged for goaltender inference but the goal was upheld after review.
James van Riemsdyk ended his streak of 14 games without a goal at 6:38 when he put a cross-crease pass from Tyler Bozak past goaltender Petr Mrazek on a power play to make it 2-0.
The Maple Leafs went up 3-0 when Nazem Kadri put a wrist shot past Mrazek's blocker at 5:49 of the second period.
"I thought we didn't come out great there tonight," Zetterberg said. "We were giving them a little bit too easy chances, I think, on their goals. The power-play [goal] you can't really say that, they made a nice play there, but we turned the puck over a little bit too much and that cost us a little bit from the beginning."
The Red Wings hit the post twice in the second period and did not have a shot on goal until Andersen made a blocker save on Tomas Tatar at 16:47.
Video: DET@TOR: Nyquist banks backhander in off Andersen
Goal of the game
Van Riemsdyk reached 20 goals for the fourth time in his eight NHL seasons when he put in a pass from the top of the crease.
"It's a nice little milestone, but that being said, we have a bigger goal in mind as a team here," van Riemsdyk said. "That's what you play for, to make the [Stanley Cup Playoffs] and get a chance to compete from there."
Video: DET@TOR: van Riemsdyk beats Mrazek for a PPG
Save of the game
Mrazek stopped Maple Leafs defenseman Jake Gardiner on a breakaway at 1:10 of the third period.
Video: DET@TOR: Mrazek denies Gardiner's breakaway chance
Highlight of the game
Andersen poke-checked the puck from Nick Jensen at the top of the goal crease at 9:55 of the second period. Jensen hit Andersen on the play and was given a goaltender interference penalty.
Unsung performance of the game
Maple Leafs center Auston Matthews backchecked deep into his zone to tie up Nyquist in the slot, preventing a scoring chance 20 seconds into the first period.
They said it
"I wasn't sure exactly how many (games) it was. I thought I was getting some good chances and I was happy with the overall process of my game, but obviously the production, goal-scoring-wise wasn't there. I know I'm relied upon to contribute in that way, so it feels nice to get one." -- Maple Leafs forward James van Riemsdyk
"On the two even-strength goals, we had the puck on our stick and we gave it away, so we had easy opportunities to advance the puck and we didn't. This team has shown lots of character all year in terms of staying with it and continuing to grind. But we need more out of more people, we need a little more out of more people, that's as simple as it comes." -- Red Wings coach Jeff Blashill
Need to know
Marchenko has played six of his 36 NHL games this season for Toronto. It was his fourth goal in 116 NHL games. … Maple Leafs center Tyler Bozak won 12 of 16 faceoffs (75 percent). … Van Riemsdyk had his first 20-goal season with the Philadelphia Flyers in 2010-11. His NHL high is 30 with Toronto in 2013-14.
Video: DET@TOR: Marchenko nets his first goal with the Leafs
Red Wings: At the Boston Bruins on Wednesday (8 p.m. ET; NBCSN, TVA Sports, NHL.TV)
Maple Leafs: Host the Philadelphia Flyers on Thursday (7:30 p.m. ET; NHLN, TVA Sports, SNO, CSN-PH, NHL.TV)
Video: Maple Leafs edge Red Wings, 3-2, in Toronto