Andrew McCutchen singled in the winning run in the seventh inning as the Giants nipped the Cardinals 3-2 in San Francisco.
Pablo Sandoval drilled a solo home run in the sixth. Dereck Rodriguez pitched into the seventh inning, and Reyes Moronta earned the win.
Kolten Wong doubled and tripled in runs to provide the offense for St. Louis.
John Gant pitched six innings but John Brebbia gave up the losing run to take the loss.