DENVER -- After turning aside St. Louis in the top of the 15th inning, the Colorado Rockies beat the Cardinals in the bottom of the inning when Corey Dickerson tripled home the winning run for a 7-6 victory on Thursday.
DJ Lemahieu singled with one out in the 15th for the Rockies. Dickerson then lined a triple to right field off Fernando Salas (0-3) for his first career walk-off hit.
Each team used 10 pitchers in the longest game of the season for the Rockies by innings and time (5 hours, 9 minutes).
In the top of the 15th, Rob Scahill (1-0) had walked Matt Holliday with one out. Holliday scampered to third when Carlos Beltran singled to right. Yadier Molina was intentionally walked to load the bases for Pete Kozma, and that strategy paid off for the Rockies when Kozma grounded into a double play.
The Rockies blew an early four-run lead but overcame one-run deficits in both the eighth and ninth.
The victory gave the Rockies a split of the four-game series and cut the Cardinals' lead in the National League Central to one game over the Pittsburgh Pirates, who beat the San Diego Padres 10-1 on Thursday.
Todd Helton, who struck out with the bases loaded against closer Edward Mujica to end the game on Wednesday, greeted Mujica with his 14th homer of the season to open the ninth. It was just the fourth blown save for Mujica in 41 opportunities.
The Cardinals went ahead 6-5 in the top of the ninth on Holliday's two-out single off Rockies closer Rex Brothers.
Each team scored a run in the eighth. Rockies center fielder Corey Dickerson had David Freese's two-out drive in his glove, but the ball fell out when he hit the wall. Freese's double scored Holliday, who led off the inning against Chad Bettis with a single just out of Herrera's reach at second.
St. Louis' 5-4 lead was brief. With one out, Charlie Blackmon doubled for his fourth hit of the game and scored when Dickerson lined a triple over the head of center fielder Jon Jay.
Starters Michael Wacha and Roy Oswalt each yielded four runs in 4 2/3 innings. Wacha had a curious Coors Field debut in his first start against the Rockies. He gave up 12 hits but didn't issue a walk and struck out seven.
The Rockies gave Roy Oswalt a four-run lead in the third that he was unable to hold. He threw just 44 of 83 pitches for strikes and walked four with five hits allowed. Oswalt gave up a two-out single in the fifth to Jay, who stole second and scored on Holliday's single that tied the score at 4.
Oswalt walked the first two batters in the fourth and paid for it when the Cardinals scored three runs to cut Colorado's lead to 4-3. Beltran singled home the first run and the other runs scored on Molina's sacrifice fly and Tony Cruz's two-out double.
Troy Tulowitzki had gone 83 at-bats since his last home run on Aug. 20, a drought that ended when he followed Dickerson's leadoff single with a two-run homer in the third to give the Rockies a 4-0 lead.
Helton led off the second with his 588th double, grounding a ball just inside first base. Singles by Charlie Culberson and Yorvit Torrealba made it 1-0, and the Rockies added a run when Herrera grounded into a double play.
NOTES: Rockies RF Michael Cuddyer didn't play because of left wrist soreness, the result of a tumbling catch on Wednesday that caused him to leave the game in the seventh. ... Rockies LHP Jorge De La Rosa might not be able to start Saturday against Arizona because of left thumb and index finger soreness that prevented him from taking his last turn and from throwing a bullpen session on Wednesday. RHP Collin McHugh would start in place of De La Rosa, as he did Monday. ... Cardinals 1B Matt Adams entered the game as a defensive replacement in the eighth, singled in the ninth and was lifted for a pinch runner. He left Wednesday's game with right elbow pain but said the tingling vanished overnight and that tape and a compression bandage on the elbow enabled him to swing without a problem. ... Molina, who has played first base late in games, made his third career start at the position. Molina went behind the plate in the eighth. He has played an entire game at first base once.