Henrik Zetterberg also scored in the shootout and Brad Stewart chipped in with a goal in regulation to snap Detroit's two-game losing streak.
Jimmy Howard made 16 saves in the win. Montreal's Carey Price made 32 saves as the Wings outshot the Canadiens 35-18.
Mike Cammalleri scored a pair of third-period goals for host Montreal. Andrei Kostitsyn assisted on both scores.
The Red Wings jumped ahead 2-0 in the first period on power-play goals by Stuart at 12:41 and by Datsyuk at 14:42.
Cammalleri brought Montreal back with a goal 9 seconds into the third period and forced overtime with a goal at 8:45.
"It was important to maybe finish it off in the shootout or an overtime win," Cammalleri said. "But the point was important, considering the way the first period started."