Desharnais scored in the second round of the shootout after both sides had come up with a goal in the first round.
The Canadiens won their third in a row and have captured seven out of eight to climb within a point of Boston for the lead in the Atlantic Division. Montreal is 8-4-1 on the road this season.
Patrick Elias scored with 1:06 left in regulation to put New Jersey ahead 3-2. Desharnais then deflected a shot past Cory Schneider with 37 seconds remaining to tie it.
Peter Budaj made 31 saves in picking up the win. Schneider stopped 27 shots.