The Canadiens held a 3-0 lead entering the third period but Victor Hedman scored twice within 4 minutes and Sami Salo netted the equalizer on a power play with 44 seconds remaining to forge a tie.
After a scoreless overtime, the contest went to shootout, during which Carey Price made three saves and Desharnais bested Anders Lindback on a shot through the pads, salvaging a victory for the Habs.
Price finished with 21 saves and P.K. Subban provided a goal and an assist as Montreal ended a three-game slide.
Lindback turned aside 31-of-34 shots for the slumping Bolts, who dropped their fifth straight.