Matt Holliday had three hits for the Cardinals, who had their NL Central Division lead over Pittsburgh trimmed to one game. The Pirates beat San Diego 10-1 on Thursday.

"We control our own fate here," Cardinals infielder Pete Kozma said. "Losing games like this hurts a little bit. We still got to play. We keep on playing the way we have been, we'll be OK."

The game took 5 hours, 9 minutes and depleted both bullpens and benches in what became a game of attrition. St. Louis used 10 pitchers and five bench players but still came away on the losing end.

"You look on the other side, that's got to be a tough game for them," Tulowitzki said. "To play that many innings, lose, we'll see if that affects them. Just being a baseball fan you want to see if that affects them down the stretch."

In the first inning, Helton tagged out Matt Carpenter at first with the hidden-ball trick. After Roy Oswalt threw to first, Helton feigned a throw back to the mound and tagged Carpenter when he stepped off the bag to end the inning.

"(Oswalt) picked over the time before and threw it back and turned around and watched him step off the back of the bag," Helton said. "I was hoping he was going to pick again and he did. It worked. It's never worked. I've done it five or six times, giving it a half-hearted effort. I can't believe it worked. It's one of those things I wanted to do my whole career."

The game contained many twists besides the hidden-ball trick. There were two late-inning comebacks by Colorado and a dramatic home run to send the game into extra innings by the Rockies first baseman who is entering the last 10 days of his career.

"It doesn't (get any better), especially with it being Todd's last week and his home run to keep us in the game," Dickerson said.

The dramatic finish, however, belonged to Colorado's young players.

DJ LeMahieu started the winning rally with a one-out single to right off Fernando Salas (0-3). Dickerson then drilled a line drive into the right-field corner as LeMahieu rounded the bases. The relay from second baseman Carpenter beat LeMahieu but catcher Yadier Molina couldn't control the ball as LeMahieu crawled to touch home.

It was Dickerson's second triple of the game and sixth of the season. Rob Scahill (1-0), Colorado's 10th pitcher, got the win.

"That late in the game, you have to take that chance," Dickerson said of LeMahieu's dash home. "I was already going to be on third for Tulo. That was a good chance right there."

The Cardinals loaded the bases in the 15th but Kozma hit into a double play to end the inning.

"We had plenty of chances throughout that whole game," Kozma said. "That was probably our best chance."

It capped a long day in which the teams traded late-game rallies.

Helton, who struck out with the bases loaded to end Wednesday's game, turned on Edward Mujica's fastball Thursday, sending an 0-1 offering into the Rockies bullpen to lead off the ninth and tie it at 6-all.

It was Mujica's fourth blown save in 41 chances.

"Everyone remembers the hit that wins the game but the hit that ties the game is as clutch as it gets," manager Walt Weiss said.

Holliday hit his former team hard, going 8 for 21 with a home run, four walks and four RBIs in the series. He reached base in six straight at-bats Thursday and was poised to be the hero with his RBI single in the ninth before Helton tied it with his 14th home run of the season.

It was part of a back-and-forth that saw the Cardinals rally from four runs down but blow two late leads.

Trailing 4-0, the Cardinals got within a run in the fourth. Oswalt walked the first two batters, Carlos Beltran singled to score Jon Jay and Holliday came home on a sacrifice fly.

"We've seen this team do that pretty consistently through this season," Cardinals manager Mike Matheny said of the comeback. "That tells about the character of this club, and I think it's going to serve us well as we move closer toward the end here and hopefully we have a real strong finish."

David Freese gave the Cardinals a 5-4 lead in the eighth with an RBI double to center, but Colorado tied it in the bottom of the inning on Dickerson's two-out triple.

Helton helped the Rockies take an early lead with a leadoff double in the second, his 588th career two-bagger. He moved to third on Charlie Culberson's infield single and scored on Yorvit Torrealba's blooper to right.

Culberson scored on a double play to make it 2-0.

Tulowitzki's two-run homer in the third made it 4-0. It was his 23rd of the season.

Game notes

Thursday's win was the longest home game since the Rockies beat San Francisco in 15 innings July 4, 2010. The longest game at Coors Field was an 18-inning loss to Arizona on Aug. 15, 2006. ... Cardinals 1B Matt Adams (right elbow soreness) did not start but came into the game as a defensive replacement in the eighth. He singled in the ninth and was replaced by a pinch-runner. ... Rockies OF Michael Cuddyer (left wrist, forearm) was out of the lineup but hopes to play Friday. ... RHP Shelby Miller (14-9) will open the Cardinals' weekend series in Milwaukee on Friday. ... Colorado righty Jhoulys Chacin (13-9) will start the first game of Colorado's series against Arizona on Friday.