CHICAGO -- Chris Carpenter put an end to the Cardinals' horrible season at Wrigley Field with another strong outing.
Juan Encarnacion also hit a three-run homer for the Cardinals, who ended their worst season at Wrigley Field with a 2-8 record.
The Cardinals won their only two games of the season at Wrigley during the three-game series.
"We're going series to series and game to game. As long as we're playing well, we'll be fine. I don't think it has anything to do with Chicago," Carpenter said. "We feel good that we came in here and took two out of three."
Carpenter (12-6) allowed two runs and seven hits for St. Louis, which leads the NL Central by 2½ games over Cincinnati. He struck out seven and didn't walk a batter. He threw a four-hitter in a 5-0 victory over the Reds in his last start on Tuesday.
Jason Isringhausen allowed Aramis Ramirez's 30th homer of the season in the ninth before picking up his 30th save in 38 chances.
With one out in the first inning, Duncan hit his 14th homer of the season off Cubs starter Juan Mateo. Albert Pujols followed with a single and Mateo walked Scott Rolen. Encarnacion then hit his 17th homer to put the Cardinals up 4-0.
Duncan has a season-high eight-game hitting streak and was 5-for-11 in the three-game series against the Cubs.
"He's been so relentless. One thing you admire is when a guy looks the same every day. ... He's just out there playing hard and making a lot of things happen," Cardinals manager Tony La Russa said.
Mateo (1-1) settled down after the first inning. He pitched seven innings and allowed four runs in his third major league start. He struck out five and walked three.
"He pitched great after the first inning. He made only one mistake and that was a hanging breaking ball to Encarnacion," Cubs manager Dusty Baker said.
Juan Pierre hit a leadoff triple off Carpenter in the sixth inning and scored on Matt Murton's single. Murton later scored on Jacque Jones' groundout.
"I think anytime you give up four runs in the first (inning) against a guy like Carpenter and you still have a chance late in the game you are really doing something, so it was a good way for us to fight back," Murton said. "Unfortunately we came up short at the end."
During the game, the Cubs announced that they traded infielder Neifi Perez to the Detroit Tigers for minor league catcher Chris Robinson.
Scott Spiezio hit a pinch-hit RBI single in the ninth for St. Louis. ... Pierre extended his hitting streak to 12 games. ... Cardinals SS David Eckstein missed his second game with a strained muscle in his left side. He is day to day.