The Cardinals moved into a tie for the second wild card with the Giants, who blew a ninth-inning lead in Los Angeles and lost 2-1 to the Dodgers.  St. Louis and San Francisco are one game behind the New York Mets, who lost to Atlanta.

The Cardinals topped the Rockies 5-3 on Monday in Colorado behind the bat and arm of Carlos Martinez.

The thin air got to the Cardinals ace, who battled through five innings.

“The altitude affects everybody a little differently,” Cardinals manager Mike Matheny said. “It affected him today, for sure.”

Martinez was pulled after the fifth with two runs allowed while the bullpen took care of the rest until pinch-hitter Ryan Raburn hit a solo homer off Kevin Siegrist in the ninth to make it 5-3.

Martinez hit a two-out double as part of a three-run fourth. Earlier in the third, Randal Grichuk lined a two-run homer.