Adam Henrique pulled Anaheim within a goal with 3:54 left in the game. The Ducks pulled John Gibson with a minute remaining in regulation to have an extra skater, but couldn't score to extend the game.
The Red Wings skated off the ice with a sense of relief after blowing third-period goals in recent games.
Nielsen scored late in the second to put the Red Wings up 2-0 even though they were held to single digits in shots.
Detroit's Jimmy Howard held up to intense pressure in the first period stopping 15 shots, and he finished with 32 saves.