Miller (6-3) broke a personal three-start winless streak, stopping the Giants on six hits. The right-hander issued only one walk and struck out seven in a 106-pitch performance.
Tony Cruz supplied a two-run two to highlight the big inning, during which the Cards sent 12 men to the plate and banged out nine hits.
Cruz and David Descalso each finished with two hits and two RBI while Matt Carpenter, Jon Jay, Allen Craig and Matt Adams each knocked in a run for National League Central-leading St. Louis, which posted a fifth win in six games.
Giants starter Matt Cain (4-3) was roughed up for seven runs on nine hits over six frames.
Charlize Theron not engaged to Sean Penn 'yet'
Pregnant Mila Kunis wins 'Best Villain' at MTV Movie Awards