The Canadiens let a three-goal lead get away in the third period but Desharnais rescued Montreal by avoiding a poke check attempt by goaltender Josh Harding and then flipping a backhander into the net.
Montreal halted a five-game losing streak.
Desharnais scored 8:50 into the third period to give Montreal a seemingly comfortable 4-1 lead.
Minnesota then produced three goals in the span of 3:43 and tied it on Devin Setoguchi's slap shot with 10 seconds left in regulation. Matt Kassian and Dany Heatley also scored in the late flurry that at least salvaged a point for the Wild in their bid to make the playoffs.
Minnesota is five points out of the eighth and final post-season berth in the Western Conference.
P.K. Subban and Lars Eller scored for the Canadiens in the opening period and the lone second-period goal from Max Pacioretty gave Montreal a 3-1 advantage.