CHICAGO (AP) -- It was all going so well for St. Louis. Chris Carpenter had a solid 2012 debut and Pete Kozma swiped home for the go-ahead run, putting the Cardinals in position to extend their timely winning streak.
Then it all fell apart in a hurry.
Darwin Barney connected for a tying two-run homer off Fernando Salas with two out in the ninth inning and David DeJesus hit a game-ending single in the 11th to lift the Chicago Cubs to a 5-4 victory on Friday.
DeJesus came to the plate with two out and lined an 0-2 pitch from Joe Kelly (5-6) into right field to score pinch-runner Brett Jackson.
Alberto Cabrera (1-1) struck out two in a perfect 11th to earn his first career victory.
The Cardinals had won four in a row and entered Friday with a 2 1/2-game lead over the Milwaukee Brewers for the second NL wild card.
''We got to a two-run lead with two strikes in the ninth, but wouldn't finish it off,'' manager Mike Matheny said.
Carpenter threw five effective innings and was in line for the win until Barney drove a 1-2 pitch from Salas into the left-field bleachers. Salas allowed a single to DeJesus with two outs and nobody on after getting two strikes on him, too.
''I made the pitches I wanted to make,'' Salas said. ''It was a fastball in to DeJesus and a soft hit and then Barney was bad luck. He made good contact.''
The Cardinals' regular closer, Jason Motte, was unavailable after pitching three days in a row and four out of the last five.
''He's been very, very good for us lately and he's been in that situation before so it's a good fit,'' Matheny said of Salas. ''You can look at a pitch now and say it should have been somewhere else, but it's easy to do now.''
Carpenter threw 77 pitches, with a light rain falling throughout the game. The 37-year-old allowed two runs and five hits, struck out two and walked one.
''My stuff wasn't as sharp as I'd like and it wasn't as sharp as it's been in the simulated games,'' Carpenter said. ''But I tried to get as many outs as I could and give us a chance. It was fun to get back out there. Hopefully my stuff will get better and sharper as I get out there more often.''
Carpenter went 4-0 in the 2011 postseason, but hadn't pitched since winning Game 7 of the World Series against the Texas Rangers. He had surgery July 19 to relieve a nerve ailment that caused numbness up and down the right side of his body.
''It was good to have him back out there and obviously he did exactly what we thought he'd do,'' Matheny said. ''He competed and made some good pitches and gave us a chance to win.''
Adding his experienced arm to the rotation boosts the Cardinals' playoff push. The Brewers open a weekend series Friday night against the Washington Nationals, who clinched a playoff berth Thursday.
Carpenter held Chicago scoreless through the first two innings, allowing three baserunners, but the Cubs jumped on him in a two-run third inning.
DeJesus led off the third with a triple and Barney followed with an RBI single. Two batters later, Alfonso Soriano doubled to the left-field corner to tie it at 2.
St. Louis regained the lead in the fourth on a botched suicide squeeze play. Kozma led off with a triple, and was credited with stealing home when catcher Welington Castillo was unable to handle a high-and-tight pitch that Daniel Descalso offered at but could not get down.
It was the Cardinals' first straight steal of home since Kerry Robinson in 2002.
Yadier Molina's two-out single got St. Louis on the board in the first inning, and Allen Craig added a sacrifice fly in the third. Matt Holliday reached four times for the Cardinals.
Descalso tacked on an RBI double in the eighth, driving in Matt Carpenter.
Cubs starter Chris Volstad allowed three runs and six hits in five innings.
NOTES: Soriano now has 104 RBIs, matching his career high set in 2005 with Texas. ... The Cardinals outrighted RHP John Gaub to make room on the 40-man roster for Carpenter, who was activated from the 60-day disabled list prior to the game. ... St. Louis sends Adam Wainwright (13-13, 3.97 ERA) to the mound against Chicago's Travis Wood (6-12, 4.25) in a Saturday matinee.