ST. LOUIS -- Jhonny Peralta might have taken awhile to adjust to his new surroundings, but with a playoff spot on the line, he's looking pretty comfortable.

The St. Louis Cardinals shortstop produced a walk-off hit to beat struggling Cincinnati Reds Monday, as his one-out RBI single over drawn-in left fielder Ryan Ludwick in the bottom of the 10th enabled the Cardinals to pull out a 6-5 win in Busch Stadium.

It was Peralta's third hit of the game, raising his average to a season-high .266. He entered the evening with one hit in 31 at-bats against Reds pitching.

"I know the pitchers more, so I feel better at the plate," he said.

Consecutive singles by left fielder Matt Holliday and first baseman Matt Adams put runners at the corners for Peralta. After swinging through a 2-1 fastball from reliever Logan Ondrusek (3-3), Peralta jumped on a meaty mistake down the middle and ended the 3-hour, 19-minute contest.

"I knew he was going to try to throw me something down and in to get a double play," Peralta said. "I tried to hit the ball to the outfield. I tried to stay in the middle of the field."

The result made a winner of rookie reliever Nick Greenwood (2-1), who needed just five pitches to work a 1-2-3 10th.

It also improved St. Louis' record to 67-57, only the second time this year it's been 10 games over .500, and pulled it within 2 1/2 games of idle Milwaukee for first place in the National League Central. The Cardinals own a 1 1/2-game lead over idle San Francisco for the NL's first wild-card spot.

It was another bitter loss for the Reds (61-64), who fell for the eighth time in 10 games and are five games behind the Giants for wild-card spot No. 2. Cincinnati dropped to 3-8 in extra-inning games and 18-30 in one-run games.

"It's baseball and you can't get it back," Reds center fielder Billy Hamilton said. "You never hear any excuses from the guys about the injuries or about being tired. We just have to look forward to a new game tomorrow."

Hamilton did his part to turn things around, drawing a one-out walk from closer Trevor Rosenthal in the ninth, then swiping second and moving to third on a throwing error by catcher A.J. Pierzynski. Right fielder Jay Bruce cashed it in with an RBI double, evening the score at 5-5.

It appeared that Pierzynski would be the hero an inning earlier when he lined a two-out single to center, scoring Peralta from second to give St. Louis a brief lead.

That capped a Cardinal comeback that erased the Reds' 4-3 edge, built on a four-run fifth. Shortstop Zack Cozart doubled in the first run of that inning, and right fielder Jay Bruce cracked a three-run homer into the seats in right, his 14th of the year.

Cincinnati starter Mike Leake nursed the lead into the seventh, but lost it when pinch-hitter Daniel Descalso slashed a one-out double to the wall in left-center, plating center fielder Jon Jay.

Leake worked seven innings, allowing eight hits and four runs with a walk and five strikeouts. St. Louis starter Justin Masterson pitched five innings, permitting five hits and four runs while walking two and whiffing five.

The Cardinals established a 3-0 lead in the third inning. The first of Adams' three hits, an RBI double, and Peralta's run-scoring single gave them two two-out runs in the first. Holliday broke an 0-for-18 slump with an RBI single in the third.

From there, the game took some rather dramatic twists before Peralta supplied the winning hit.

"I saw some tough, grinding at-bats by our guys," St. Louis manager Mike Matheny said. "I've seen the same approach by our guys all year and it's starting to pay off for them."

NOTES: Cincinnati activated 2B Brandon Phillips (left thumb) and RHP Logan Ondrusek (shoulder strain) from the 15-day disabled list Monday while optioning C Tucker Barnhart and RHP Dylan Axelrod to Triple-A Louisville. The Reds also sent RHP Curtis Partch, the 26th man in Sunday's doubleheader at Colorado, back to Louisville. ... St. Louis RHP Michael Wacha (stress reaction) threw his second bullpen session Monday after undergoing an MRI. Wacha, who has been on the disabled list since June 22, is still hoping to start a rehab assignment before minor league seasons end in early September. ... Cincinnati 3B Todd Frazier (back spasms) returned to the lineup after a three-game absence. Frazier was injured Thursday night in a 7-3 loss at Colorado.