St. Louis captured two of the three contests in the final action prior to the All-Star break.
"The win is obviously why you play, because if you keep score you want to win," Cardinals manager Tony La Russa said. "It was really important that we put that game last night behind us, and with this group, I could hear the conversations in there. They were getting themselves ready to play. What was important is we came out there and showed everybody that, look, you beat us last night and we're going to try to beat you today."
Cards starter Joel Pineiro was staked to a 4-1 lead, but he ended up with no decision after allowing six runs on 10 hits over 5 2/3 innings.
"Pineiro showed in Philadelphia what he has," La Russa said. "I just think sometimes he tries so hard to make a pitch that he just misses the zone. He makes a great pitch and gets a good result, and then he'll miss and he doesn't get away with it. This is the big leagues, and you just don't get away with it here."
Pineiro thought his outing left room for improvement.
"It could have been better," he said. "As a starting pitcher, I can't let a game get away like that. I went from throwing 50 some pitches to throwing 107 in five and one-third. That's when you give credit to the other team -- they battled back, but I've just got to find a way in situations like that to make better pitches and try to get out of the inning. I didn't do that today."
Pirates starter Ian Snell hurled five innings and surrendered four runs on five hits.
The Pirates jumped out to a 1-0 advantage in the bottom of the first inning. Chris Gomez singled and went to second when Ryan Doumit was hit by a pitch. Gomez scored on a Xavier Nady RBI single.
The Cards broke through against Snell in the fourth inning, plating four runs with two outs. Back-to-back doubles by Troy Glaus and Chris Duncan made it 1-1. After Yadier Molina drew a walk, Aaron Miles stroked a three-run homer to right field to put the Cards on top. It was Miles' second homer of the season.
Pittsburgh stormed back to tie the game at 4 in the bottom of the fifth inning. Pinch-hitter Freddy Sanchez and Jack Wilson had back-to-back singles and both scored on an RBI double by Doumit. Jason Bay sent Doumit home with an RBI single to left.
St. Louis recaptured the lead in the sixth inning, plating an unearned run off Bucs reliever Sean Burnett. Molina singled and advanced to second on an error by second baseman Gomez. Molina eventually scored on a fielder's choice groundout by Cesar Izturis to give the Cards a 5-4 lead.
The Pirates got to Pineiro again in the bottom of the sixth, knocking him out of the game. Burnett garnered his first Major League hit, a one-out double. Nate McLouth walked, and then Gomez smacked a two-run double to put Pittsburgh ahead, 6-5. Russ Springer came on in relief and got out of the inning.
The Pirates inserted reliever Franquelis Osoria. He was roughed up for four runs in the top of the seventh inning. As Glaus stroked an RBI double, Duncan had an RBI single and Miles stroked a two-run triple to give him five RBIs in the game.
"I got some good pitches to hit," Miles said. "I've been beat by Snell on the inside corner pretty much all year, and so I figured he might be coming in there and just got lucky and got my barrel on it and got it up."
Cards outfielder Ryan Ludwick connected for a solo home run in the eighth inning and Glaus added a solo shot -- his 15th homer of the season -- in the ninth inning.
Glaus finished the three-game series with 10 hits in 13 at-bats.
"It was just a matter of putting the barrel on the ball and not having it go to anybody," Glaus explained. "I hit a handful of balls hard and a few not so hard, but they got through."
St. Louis came into the series scuffling offensively, but the Redbirds pounded out 50 hits and scored 28 runs in the three-game series.
George Von Benko is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.