Allen stopped 15 of 16 shots in the first period before Montreal held San Jose to 16 shots over the final two periods, including seven in the third.
"I thought we played responsible," Allen said. "We weren't risky in the third period. We had a couple good looks and had two goals. We could have gotten frustrated after the first two [periods]. We had some good chances to score. Their goalie played really well."
Kaiden Guhle and Jesse Ylonen scored 1:52 apart, and Christian Dvorak had a goal and an assist for the Canadiens (26-30-4), who started a four-game road trip.
"Jake was solid," Montreal coach Martin St. Louis said. "[A] big reason why we won the game. I didn't mind our first two periods, I just felt we were leaving a lot on the table because we just weren't quite executing. We talked between the second and third that, you know, we need the third to be our best period of tonight, and it was."