PITTSBURGH -- Andrew McCutchen's two-run homer in the bottom of the 14th inning gave the Pittsburgh Pirates a thrilling 6-5 victory over the St. Louis Cardinals on Saturday night on in a matchup between the teams with the two best records in the National League.
It was McCutchen's 12th home run of the season and fifth career walk-off shot. He also extended his career-best hitting streak to 18 games after going 0-for-3 with three walks in a game that last five hours and three minutes.
Second baseman Neil Walker singled to lead off the inning and McCutchen followed with a 415-foot drive to center fielder off reliever Nick Greenwood, who was recalled from Triple-a Memphis before the game.
The Pirates (52-35) drew within 3 1/2 games of the Cardinals (56-32) in the NL Central with their seventh win in eight games. It is the closest the Pirates have been to first place since April 30 when they were three games back.
The Pirates have won two games in the four-game series that concludes Sunday night and finishes the season's first half.
Both teams scored a run in the 10th.
First baseman Mark Reynolds' solo home run in the top of the inning, his second of the game and seventh of the season, against rookie reliever Deolis Guerra put the Cardinals ahead 4-3.
In the bottom half, rookie third baseman Jung Ho Kang hit a leadoff triple and scored the tying run on catcher Chris Stewart's one-out single off closer Trevor Rosenthal.
The Pirates tied the score at 3 in the eighth on consecutive RBI singles by Kang and first baseman Pedro Alvarez.
Walker and Kang had two hits each for the Pirates.
Left fielder Randal Grichuk had three hits for the Cardinals and Peralta, Reynolds and second baseman Kolten Wong added two apiece.
Pirates starter AJ Burnett had not allowed more than two runs in any of his other eight starts at PNC Park this season.
Burnett's ERA rose to 2.11 from 1.99 as he came up short in his attempt to be the first Pirates pitcher to have a sub-2.00 ERA at the All-Star break since Bob Veale was at 1.90 in 1968.
Cardinals right-hander John Lackey pitched into the seventh inning for the eighth time in his last nine starts but was a not factor in the decision, giving up one run and five hits in 6 2/3 innings with five strikeouts and two walks.
In his last six starts, the right-hander is 4-1 with a 1.69 ERA.
Reynolds opened the scoring by hitting a controversial home run in the second inning, a solo shot deep into the left-field bleachers with two outs for his seventh homer of the season.
That led to the ejections of Pirates manager Clint Hurdle and catcher Francisco Cervelli by home plate umpire Vic Carapazza for arguing.
The Pirates thought Reynolds struck out swinging on the previous pitch on a 1-2 count, but Carapazza ruled a foul tip. Video replays were clear that Reynolds swung through the pitch, but the play could not be reviewed under Major League Baseball rules.
The Cardinals doubled their lead to 2-0 in the third on a sacrifice fly by catcher Yadier Molina and added a run in the fifth when Pirates first baseman Pedro Alvarez misplayed right fielder Jason Heyward's chopper for an error.
Burnett got the Pirates on the board in the bottom of the fifth with his first home run in nearly 10 years, a solo shot into the left-field bleachers. It was the 38-year-old's fourth home run of his 17th-year career and first since July 24, 2005, when he was playing for the Marlins and connected off San Francisco's Kevin Correia.
NOTES: The Cardinals placed RHP Mitch Harris on the 15-day disabled list, retroactive to July 9, with a right groin strain. St. Louis also recalled RHP Sam Greenwood and RHP Sam Tuivailala from Triple-A Memphis and optioned 1B Xavier Scruggs to the same club. ... Pirates LF Starling Marte returned to the lineup after missing five games with a strained left oblique muscle. ... Pirates LHP Francisco Liriano (5-6, 2.99 ERA) will face Cardinals rookie LHP Tim Cooney (0-0, 3.95) on Sunday night in the finale of the four-game series. Liriano is 4-2 with a 2.08 ERA and 69 strikeouts in 60 2/3 innings in nine starts since giving up a season-high seven runs in a loss to Minnesota on May 19. He is 4-2 with a 2.38 ERA in 10 starts against the Cardinals. Cooney, called up from Memphis on July 2 when LHP Jaime Garcia went on the DL, will be making his fourth career start -- his first against the Pirates.