The Cardinals had already seemingly put the game away before Miguel Socolovich entered in relief.
But in the eighth inning, the right-handed reliever allowed a two-out solo home run to Giants shortstop Brandon Crawford, and then a solo homer to left fielder Eduardo Nunez as the Giants cut the Cardinals' lead to 7-3. Sunday was the second time this season the Giants had hit back-to-back shots.
Socolovich retired the first two batters in the eighth via strikeout, and ended the inning when catcher Nick Hundley also struck out.
Cecil enters for Wainwright, cleans up seventh
Reliever Brett Cecil came in for Adam Wainwright in the top of the seventh with trouble afoot.