Adams' homer rallies Cardinals past Pirates 8-7

St. Louis Cardinals' Matt Adams, right and Pittsburgh Pirates catcher Francisco Cervelli watch Adams' three-run home run during the eighth inning of a

St. Louis Cardinals' Matt Adams, right and Pittsburgh Pirates catcher Francisco Cervelli watch Adams' three-run home run during the eighth inning of a

Pittsburgh Pirates' Josh Harrison (5) rounds the bases after hitting a solo home run off St. Louis Cardinals relief pitcher Chasen Shreve during the s

Pittsburgh Pirates' Josh Harrison (5) rounds the bases after hitting a solo home run off St. Louis Cardinals relief pitcher Chasen Shreve during the s

St. Louis Cardinals' Matt Adams (15) is congratulated by teammate Adolis Garcia (28) after hitting a three-run home run during the eighth inning of a

St. Louis Cardinals' Matt Adams (15) is congratulated by teammate Adolis Garcia (28) after hitting a three-run home run during the eighth inning of a

St. Louis Cardinals' Matt Adams celebrates after hitting a three-run home run during the eighth inning of a baseball game against the Pittsburgh Pirat

St. Louis Cardinals' Matt Adams celebrates after hitting a three-run home run during the eighth inning of a baseball game against the Pittsburgh Pirat

St. Louis Cardinals' Matt Adams celebrates after hitting a three-run home run during the eighth inning of a baseball game against the Pittsburgh Pirat

St. Louis Cardinals' Matt Adams celebrates after hitting a three-run home run during the eighth inning of a baseball game against the Pittsburgh Pirat

Pittsburgh Pirates catcher Francisco Cervelli, left, talks with relief pitcher Edgar Santana during the eighth inning of a baseball game against the S

Pittsburgh Pirates catcher Francisco Cervelli, left, talks with relief pitcher Edgar Santana during the eighth inning of a baseball game against the S

St. Louis Cardinals' Marcell Ozuna, right, scores past Pittsburgh Pirates catcher Francisco Cervelli during the fourth inning of a baseball game Monda

St. Louis Cardinals' Marcell Ozuna, right, scores past Pittsburgh Pirates catcher Francisco Cervelli during the fourth inning of a baseball game Monda

St. Louis Cardinals pitching coach Mike Maddux, left, talks with starting pitcher Adam Wainwright during the third inning of a baseball game against t

St. Louis Cardinals pitching coach Mike Maddux, left, talks with starting pitcher Adam Wainwright during the third inning of a baseball game against t

Pittsburgh Pirates' Colin Moran rounds the bases after hitting a solo home run during the second inning of a baseball game Monday, Sept. 10, 2018, in

Pittsburgh Pirates' Colin Moran rounds the bases after hitting a solo home run during the second inning of a baseball game Monday, Sept. 10, 2018, in

Pittsburgh Pirates' Starling Marte (6) points skyward after hitting a two-run home run as teammate Trevor Williams (34) watches during the third innin

Pittsburgh Pirates' Starling Marte (6) points skyward after hitting a two-run home run as teammate Trevor Williams (34) watches during the third innin

ST. LOUIS (AP) — ST. LOUIS (AP) — Matt Adams hit a three-run homer in the eighth inning to rally the St. Louis Cardinals to an 8-7 victory over the Pittsburgh Pirates on Monday night.

St. Louis, which overcame deficits of 4-0 and 6-4, moved two games ahead of the Los Angeles Dodgers in the race for the second wild card spot in the NL. Cincinnati beat Los Angeles 10-6 Monday.

Josh Harrison, Colin Moran and Starling Marte homered for Pittsburgh, which had its five-game winning streak snapped.

Adams homered off Edgar Santana (2-3) to erase a 6-4 deficit.

John Brebbia (2-3) picked up the win for St. Louis, which has won two in a row.

Carlos Martinez, a former starter, picked up his third save in as many chances. He gave up run-scoring double to Josh Bell with two out. But he got Francisco Cervelli to ground out to DeJong at deep short to end the game. The play was challenged, but Cervelli was ruled out after a video review.

St. Louis right-hander Adam Wainwright, making his first start since May 13, gave up four runs on seven hits in five innings. He retired the last eight batters after giving up three runs in the third.

Matt Carpenter walked to start the go-ahead rally. Jose Martinez followed with a hit to set the stage for Adams' heroics.

Harrison broke a 4-4 tie with a solo shot off Chasen Shreve in sixth. Adam Frazier added a run-scoring hit for a 6-4 lead.

The Cardinals scored four times in the fourth off Trevor Williams, who had allowed just four earned runs over his previous nine starts. Paul DeJong had a two-run double and scored on Harrison Bader's game-tying sacrifice fly.

Williams allowed six hits, struck out six and didn't walk a batter.

Moran homered in the second off Wainwright, who struck out three and did not walk a batter. Marte ripped a two-run shot in the third, his 19th of the season, for a 3-0 lead.

St. Louis is 33-18 under manager Mike Shildt, who took over for Mike Matheny on July 15.

TRAINER'S ROOM

Cardinals: C Yadier Molina missed his fourth straight game with left hamstring tightness suffered Wednesday in Washington. He is expected to return sometime during the current seven-game homestand that began on Monday. ... RHP Adam Wainwright was activated from the 60-day disabled list prior to the game.

UP NEXT

RHP Joe Musgrove (6-8, 3.75) takes on RHP Miles Mikolas (14-4, 3.06) in the second game of the three-game set on Tuesday. Musgrove has gone at least seven innings in five of his last nine starts. The Cardinals are 7-1 in Mikolas' last eight starts.