The goal by Desharnais came on the power play with 6:16 to go in the second period and gave the Canadiens a 2-0 lead. It was on that goal that Subban produced his 100th assist.
Andrei Markov was credited with an assist on all three Montreal goals.
Montreal won its fourth in a row thanks in part to a 24-save performance from Carey Price.
Alex Galchenyuk and Brendan Gallagher added goals for Montreal, while Matt Moulson was the lone Buffalo scorer.
Ryan Miller gave up three goals on 31 shots in what was the Sabres' fifth straight loss. Buffalo's 5-20-1 record is the worst in the NHL.