Molina drove in three runs and Pujols added a solo shot as the Cardinals avoided a three-game sweep at the hands of the Cubs.
Jon Jay also chipped in a bases-empty homer for Cards, who won for only the second time in six games and remained 8 1/2 games behind National League Central-leading Milwaukee.
Jake Westbrook (10-7) earned the victory, giving up two runs on seven hits over seven frames.
Chicago starter Rodrigo Lopez (4-4), meanwhile, surrendered five runs on 10 hits in a 5 1/3-inning effort.
Aramis Ramirez collected both the Cubs' RBI.