ST. LOUIS -- Adron Chambers opted for a simple approach while batting in the bottom of the 14th inning early Wednesday morning.
"I was just trying to put it in play," the St. Louis Cardinals backup outfielder said. "I stayed short, did what I know how to do."
The result was a single that scored Jon Jay from second base as the Cardinals ended a four-hour, 55-minute marathon with the National League Central-leading Pittsburgh Pirates by grabbing a 4-3 win at Busch Stadium.
Sam Freeman (1-0) pitched the 14th to earn his first major league win as St. Louis (68-50) pulled within two games of the Pirates in the division. It was the fourth straight loss for Pittsburgh (70-48).
"Most of us won't have a voice tomorrow," Cardinals manager Mike Matheny said. "The guys wanted this one bad. A lot of guys stepped up. It was one of those games that you felt like you somehow had to win."
With one out in the 14th, Jay singled off Jared Hughes (2-3) for his fourth hit of the night and stole second. Chambers lined a 2-2 pitch to shallow left, and Jay barely beat Starling Marte's strong, accurate throw home, sliding under the tag of Russell Martin.
It was just the Cardinals' second walk-off win of the year, as well as their second extra-inning victory.
"A win like tonight could be a catalyst for the rest of the season," Matheny said.
The game went to extra innings as the result of a stunning gaffe in the bottom of the ninth. After Marte dropped Daniel Descalso's fly ball for a two-base error with one out, closer Mark Melancon fanned Matt Carpenter.
Carlos Beltran walked, and Allen Craig cashed in the miscue with his 88th RBI of the year. Craig's single to right-center tied the game at 3.
"It happens to the best of us," Pirates center field Andrew McCutchen said of Marte, who committed his seventh error. "You hate that it happened to him. All you can do is erase it. I've missed them before."
The teams then traded missed opportunities from the 10th through the 13th. St. Louis left the bases loaded in the 10th and had an 11th-inning threat thwarted with an extremely rare double play.
With men at first and third and one out, reliever Seth Maness bounced into a 6-9-3 double play as right fielder Josh Harrison -- playing on top of second base in a five-man infield -- made the pivot.
Roles were reversed in the 13th when Pittsburgh filled the bases with one out. Maness induced a 5-3 double play out of Harrison to wriggle out of trouble.
"We had plenty of chances to (win) the game," McCutchen said. "We gave ourselves opportunities and weren't able to succeed."
Pittsburgh wasted little time jumping on St. Louis ace Adam Wainwright, as McCutchen cracked a two-run homer in the top of the first, his 17th of the year. Jordy Mercer followed in the second with a one-out solo shot to left, his fifth of the season, making it 3-0.
The Cardinals sliced the deficit to one with a sixth-inning rally. A run scored on David Freese's double-play grounder, and Jay drove in another with a single.
McCutchen, Mercer and Neil Walker each had two hits for Pittsburgh. Carpenter collected three hits for St. Louis, and Craig and Matt Holliday had two hits apiece.
Holliday left the game in the bottom of the 10th with what Matheny termed a mild ankle sprain.
Wainwright allowed three runs in seven innings before the Cardinals bullpen fired off seven scoreless innings.
"That's our job," Freeman said of the bullpen's feat. "Every time the phone rang, I got myself ready. That way, I'm never surprised when it's for me. I'm just trying to prove I can do the job."
Pittsburgh starter Charlie Morton threw six innings of two-run ball and was in line for his first win in six decisions against St. Louis. However, the light-hitting Chambers, who was just 1-for-10 since being called up from Triple-A Memphis on July 31, stole the hero's role.
NOTES: The Cardinals called up INF Jermaine Curtis from Memphis, a move designed to give them five position players on the bench. They sent down rookie RHP Michael Blazek. Curtis played in three games for the Cardinals earlier this year, going 0-for-2. ... Pittsburgh juggled its rotation for the last two games of this series, moving up LHP Francisco Liriano and RHP A.J. Burnett a day and moving rookie RHP Gerrit Cole back to start the opener of a weekend series against the visiting Arizona Diamondbacks. ... St. Louis will start rookie RHP Shelby Miller on Wednesday night against Liriano. Cardinals RHP Lance Lynn opposes Burnett in Thursday's series finale ... The Pirates scratched RF Jose Tabata (flu-like symptoms) 90 minutes before first pitch and inserted Andrew Lambo, who made his major league debut. Lambo went 0-for-3.