ST. LOUIS (AP) — Matt Adams hit a three-run homer in the eighth inning to rally St. Louis past Pittsburgh, 8-7, Monday.
The Cardinals, who overcame deficits of 4-0 and 6-4, moved two games ahead of the Dodgers in the race for the second NL wild card.
Josh Harrison, Colin Moran and Starling Marte homered for the Pirates.
Adams homered off Edgar Santana (2-3) to erase a 6-4 deficit. John Brebbia (2-3) picked up the win.
Carlos Martinez, a former starter, earned his third save in three chances. He gave up a run-scoring double to Josh Bell with two outs but got Francisco Cervelli to ground out to deep shortstop to end the game.
St. Louis right-hander Adam Wainwright, making his first start since May 13, gave up four runs and seven hits in five innings. He retired the last eight batters after giving up three runs in the third.