The Canadiens had forged a 1-1 tie when Brian Gionta scored on a backhander with 28 seconds remaining in regulation.
But the Red Wings salvaged the victory as time was running out in the extra frame.
Todd Bertuzzi also scored for Detroit, which began post-Olympics play with a fourth win in six games.
Peter Budaj, starting in place of Carey Price, finished with 28 saves for Montreal, which had its three-game win streak ended.
Rosie O'Donnell unveils nearly 50-pound weight loss
Members of Congress to keep receiving porn magazine