Berglund tied it with a slap shot and then put a backhander past Smith 2:02 later to give the Blues the lead for good.
Scott Nichol added a second-period goal for St. Louis, after which Vladimir Sobotka and Alex Pietrangelo scored in the third.
St. Louis halted a two-game skid with rookie Jake Allen making 23 saves in the victory. Allen was recalled from the American Hockey League earlier this week.
Smith gave up all six goals on 29 shots.
Boston schools pull out free condoms over wrapping complaints
Millions of Getty images now available for free via embed tool