Barney spoiled Chris Carpenter's season debut with a two-run, game-tying homer with two outs in the ninth inning, and David DeJesus hit a game-ending single in the 11th to help the Chicago Cubs beat the St. Louis Cardinals 5-4 on Friday.
DeJesus hit an 0-2 pitch off of Joe Kelly (5-6) to 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 entered Friday with a 2 1/2-game lead over the Milwaukee Brewers for the second wild card spot.
Carpenter threw five effective innings and was in line for the win until Barney launched a 1-2 pitch off of reliever Fernando Salas into the left field bleachers.
"I'm just trying to get Rizzo up," Barney said. "Fortunately, he threw me another fastball and I got to it. I was worried about the wind, that the wind was gonna knock it down, but it went."
The Cardinals' regular closer, Jason Motte, had pitched three days in a row and four out of the last five.
Barney has 25 hits in September, matching his highest output of any month this season, with eight games yet to play. The 26-year-old is hitting .352 this month.
"I feel like there's some times where I've gone through periods of adjustments and I'm not really helping out the offense that much," Barney said. "It's one of those things where we're working on finding an approach I can stick
Carpenter threw 77 pitches in his debut, with a light rain falling throughout the game. The 37-year-old allowed two runs on five hits. He 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. "It was fun to get back out there. Hopefully my stuff will get better and sharper as I get out there more often."
"This is something to build off."
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.
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.
"Good to have him back out there and obviously he did exactly what we thought he'd do—he competed and made some good pitches and gave us a chance to win," Cardinals manager Mike Matheny said of Carpenter.
Carpenter held the Cubs scoreless through the first two innings, allowing three baserunners, but the aggressive Chicago bats jumped on him in a two-run third inning.
DeJesus, who had four hits, 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 the game at 2-2.
Carpenter retired eight of the last nine batters he faced after Soriano's double.
"I'm sure Carpenter will tell you it wasn't his best stuff," Cubs manager Dale Sveum said. "I've obviously seen him with much better stuff and sharpness to everything. I think he got away with a lot of things."
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 lay down.
It was the Cardinals' first straight steal of home since Kerry Robinson in 2002.
Yadier Molina's two-out single put St. Louis on the board in the first inning, and Allen Craig added a sac fly in the third. Matt Holliday reached base four times for the Cardinals.
Descalso tacked on an insurance run with an eighth-inning double to chase home Matt Carpenter.
Cubs starter Chris Volstad allowed three runs in five innings of work. He gave up six hits and walked three.
NOTES: Soriano matched a career-high with 104 RBIs, 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.