Miller logged his fourth shutout of the season for Buffalo, which used the win to maintain its three-point lead over Carolina for the eighth and final Eastern Conference playoff spot.
Gerbe scored midway through the second period and added an empty-netter with 22 seconds left to play for the Sabres.
Carey Price gave up only one goal in 23 shots faced yet absorbed the loss for Montreal, which fell three points behind Boston atop the Northeast Division.
The Canadiens were shut out only one game after posting their biggest offensive display of the season in an 8-1 pounding of Minnesota Sunday.
Millions of Getty images now available for free via embed tool
Boston schools pull out free condoms over wrapping complaints