Montreal regained the lead with two goals in 43 seconds in the second period.
"We had the lead, and then we self-destructed a little bit," Detroit forward Justin Abdelkader said. "We've had a few games like this, where we give up a couple quick goals and put ourselves in a hole."
Hudon made it 2-2 at 4:46, flipping a loose puck into the top of the net for his third goal of the season.
Shaw put Montreal ahead 3-2 at 5:29, breaking in alone after an Abdelkader turnover and beating Howard with a wrist shot for his sixth goal.
"You don't have any energy, because you suck the energy out of yourself by giving away easy goals," Red Wings coach Jeff Blashill said. "You have no chance to win in this league when you give away easy goals."