Brad Eldred hit a pair of solo shots for his first multihomer game and the Pirates' bullpen worked 7 1/3 innings after Oliver Perez was ejected, keeping the Cardinals' magic number for clinching the division at two with a 5-3 victory Wednesday.
"It feels good to play them tough, not have them clinch against us," Pittsburgh interim manager Pete Mackanin said. "We didn't make it easy for them."
The Pirates won for only the fourth time in 19 games. The Cardinals completed a 6-4 homestand and begin a 10-game road trip that starts with a four-game series in Chicago on Thursday.
Second baseman Mark Grudzielanek said it would have been more satisfying to clinch in Chicago if the Cubs had a contending team.
"If they might have been a little bit closer it would probably be a little more special," Grudzielanek said. "But it's one of those things where I don't think they've really got their thing together."
Closing in on their fifth playoff berth in six years, the Cardinals could still clinch a tie for the NL Central championship later Wednesday night with a Houston loss to Florida.
Jason Bay homered, doubled and drove in two runs off Jason Marquis (12-14) for the Pirates, who finished 4-12 against the Cardinals this season. Bay is 10-for-19 against Marquis with three homers, four doubles, a triple and eight RBIs, and he added a third hit with a single in the seventh.
Eldred, the Pirates' minor league player of the year last season, homered leading off the second and hit his ninth over the visitors' bullpen in left field with one out in the sixth for a 4-1 lead.
Perez was ejected with two outs in the second inning after hitting Hector Luna in the left leg with a pitch during an otherwise quiet game between teams that feuded recently. Perez was on the 15-day disabled list with a broken big toe when the teams had a pregame scuffle on Aug. 24 in Pittsburgh that led to suspensions of Pirates batting coach Gerald Perry and Cardinals pitching coach Dave Duncan along with then-Pirates manager Lloyd McClendon.
This was Perry's first game back after an eight-game banishment. Plate umpire Eric Cooper appeared to warn Marquis before the top of the third.
Cooper said he was alerted by Bob Watson, baseball's vice president of on-field operations, about potential trouble between the teams before the series. He also noted that Luna was at the center of the confrontation in Pittsburgh after his hard slide knocked out second baseman Jose Castillo for the season with a knee injury.
"He had been hit once before in the series," Cooper told a pool reporter. "It was certain given the variables I had to work with in that particular game, in that particular situation with the pitcher hitting behind him, I thought he was throwing at him intentionally."
Perez denied he plunked Luna on purpose.
"I had a no-hitter, that is why I was so surprised," Perez said. "I want to show what I can do. There's no way I would ever throw at anybody intentionally."
Mackanin understood Cooper's view.
"I can see why he's suspicious," he said. "But we had played two clean games."
Mike Gonzalez, the Pirates' seventh pitcher, got two outs for his second save. He struck out pinch-hitter Reggie Sanders and retired So Taguchi on a grounder with runners at second and third for Pittsburgh's first save in 28 games. Ryan Vogelsong (2-1) allowed a run in 2 1-3 innings.
Bay hit his 29th homer in the first, and Eldred's first homer made it 2-0. Bay's RBI double made it 3-1 in the fifth.
Einar Diaz's RBI double came in the fourth. Leadoff walks issued by John Grabow to David Eckstein and Grudzielanek in the seventh helped the Cardinals cut the gap to one on Albert Pujols' run-scoring groundout and John Gall's sacrifice fly to the left-field wall, both off Jose Mesa.
Tike Redman's RBI double in the ninth off Julian Tavarez put the Pirates ahead 5-3.
Marquis lasted six innings and gave up four runs, three earned, and eight hits. He won his previous three starts, two of them complete games.
"Mentally, I feel great," Marquis said. "You have games where you get beat even though you've thrown the ball well."