SAN FRANCISCO -- Michael Wacha pitched six strong innings and Randal Grichuk hit a two-run homer as the St. Louis Cardinals defeated the San Francisco Giants 5-2 on Thursday night.
The Giants were without staff ace Madison Bumgarner, a late scratch with flu symptoms, as they lost for the sixth time in seven games.
Wacha (10-7) gave up one run, four hits and two walks as he bounced back from a tough stretch. In his three previous starts he was 0-3 with a 10.22 ERA.
The Cardinals moved within 5 1/2 games of the idle Colorado Rockies in the NL wild card race. They failed to gain ground in the NL Central as the first-place Chicago Cubs defeated the Atlanta Braves to maintain a six-game lead.
Tommy Pham was 3 for 4 with a double and two RBIs for St. Louis.
The Cardinals broke a scoreless tie in the top of the second when Grichuk hit a two-run homer off Giants starter Matt Cain (3-11).
Grichuk's 18th home run came on a 1-2 curveball Cain hung over the middle of the plate.
Five Cardinals relievers combined to allow one run over the final three innings with Seung Hwan Oh getting his 20th save.
The punchless Giants were coming off a 1-5 trip in which they scored 10 runs.
Brandon Crawford hit what initially was called a two-run home run in the bottom of the ninth that was overturned by a 4-minute, 8-second video review, with umpires apparently ruling that fans reached over the brick wall in right field.
Crawford had to go back on the field, sent to second base with a double that scored Buster Posey.
Grichuk is among seven Cardinals with 15 or more home runs, tops in the NL and tied for second in the majors with the Houston Astros and Baltimore Orioles. The Texas Rangers lead the major with nine.
Grichuk homered in the toughest pitcher's park in the majors. Teams are combining for 1.51 home runs per game at AT&T Park in a year in which teams are combining for the most home runs in major league history (2.54).
Cardinals: LHP Kevin Siegrist was designated for assignment after being activated from the disabled list with a left forearm injury. In a corresponding move RHP John Gant was called up from Triple-A Memphis.
Giants: OF Christian Slater will start a rehab assignment with Triple-A Sacramento on Friday and is expected to be activated after playing three or four games, manager Bruce Bochy said. The 24-year-old rookie has been on the disabled list since July 8 with strained right groin. . Posey was back in the lineup after missing three games with a thumb injury.
RHP Jack Flaherty will make his major league debut for the Cardinals on Friday. The 21-year-old prospect was a combined 14-4 with a 2.18 ERA in 25 starts this year at Double-A Springfield and Triple-A Memphis. San Francisco RHP Johnny Cueto (6-7, 4.59) will pitch for the first time since going on the disabled list with a flexor strain on July 15.