Max Pacioretty scored a goal and an assist, and Shea Weber scored for Montreal (31-18-8), which is 1-4-1 in its past six games. Al Montoya made 18 saves.
"We played a pretty good game, but we've got to find ways to win and the losing and winning, the losing and winning isn't just going to cut it," said Canadiens defenseman Nathan Beaulieu, who assisted on Pacioretty's goal. "So we need to find some answers, and find them quick."
Berglund's second goal of the game at 19:35 of the second period gave the Blues their third one-goal lead at 3-2.
Berglund's first of the game put St. Louis up 1-0 at 3:49 of the first period. He scored his 15th goal on a deflection past Montoya, who fell down when he moved to his left to face a shot by Blues defenseman Alex Pietrangelo.
"I just went to the net and [Pietrangelo] had a great shot-pass to me so it was an open net," Berglund said.
It was the first goal Montoya allowed in four home games, ending his shutout streak of 159:10 at Bell Centre.
Weber made it 1-1 on Montreal's third shot at 16:39 of the first, a slap shot from the right point for his 13th goal.
"It was a terrible goal, it shouldn't have gone in," Allen said. "A pee-wee goalie could have stopped it."
Perron made it 2-1 with his 12th goal at 7:20 of the second.
Pacioretty, who was sent home before the Canadiens' morning skate because of the flu, scored his 28th goal at 12:55 to make it 2-2.