Updated

Pedro Ciriaco hit a two-run double in a run eighth inning, and the Pittsburgh Pirates survived a shaky ninth to 5 win over St. Louis in the opener of a three-game set at PNC Park.

Neil Walker went 3-for-4 with an RBI and run scored while Ryan Doumit had two hits and an RBI for the Pirates, who had dropped four of five coming into the game.

Jason Grilli (2-1) got the win for pitching a 1-2-3 eighth inning, while starter Brad Lincoln gave up four runs -- three earned -- on eight hits over 5 1/3 innings.

Albert Pujols hit a two-run homer and drove in three for the Cardinals, who had a five-game winning streak stopped. Kyle Lohse went six innings in the start and was charged with three runs on eight hits.

While the winning streak had helped the Cardinals get back into the playoff chase, Monday's loss pushed them 6 1/2 games back of idle Milwaukee for the top spot in the NL Central. Atlanta's loss to Florida in extra innings kept St. Louis 4 1/2 games back of the wild card lead.

"It's tough and it's going to happen from time to time," said Lohse. "We just have to come back out here tomorrow and try to win the series."

The Pirates trailed heading into the eighth, but three runs in the frame gave them the lead.

Octavio Dotel got the first out, but then walked Derrek Lee before stepping aside for Marc Rzepczynski (0-2), who promptly gave up a game-tying double to Doumit.

Later in the inning with the bases full and Fernando Salas on the mound, Ciriaco smacked a double to right for a 6-4 lead.

"He just battled in that at-bat," said Pittsburgh manager Clint Hurdle about Ciriaco. "He's continuing to grow and has worked hard to make the right adjustments. It was a big moment for him and I'm happy for him."

The two-run lead proved essential, as Joel Hanrahan ran into trouble. Daniel Descalso led off with a single, but Yadier Molina followed with a groundout. After a Skip Schumaker single put runners on the corners, a wild pitch made it a one-run game. Nick Punto then walked, but Rafael Furcal grounded out to first and Corey Patterson struck out to give Hanrahan his 37th save.

St. Louis put its first two batters of the game on base, leading to Pujols' sacrifice fly.

The Pirates, though, did answer with two runs in the bottom of the first to grab the lead. Alex Presley led off with a single, and Walker followed with a double before Andrew McCutchen and Lee hit consecutive sacrifice flies.

The Cardinals tied the game in the third on three consecutive singles, capped by Furcal's base hit that scored Schumaker.

The Pirates made it 3-2 in the bottom of the fifth, when Presley led off with a single and Walker followed with a double.

However, the Cardinals quickly got the lead back in the sixth, when Jon Jay led off with a single and Pujols followed with his 35th home run of the year.

Game Notes

Pujols has hit at least 35 home runs in nine of his 11 seasons. Also, he has 92 RBI and has never failed to achieve the 100-RBI mark in any season...The Cardinals have won eight of the 14 games against the Pirates this season.