Milwaukee Brewers' Nyjer Morgan, right, reaches first on a bunt, and a throwing error by Chicago Cubs starting pitcher Randy Wells, left, during the third inning.
Starlin Castro looped a one-out single to right field in the 10th inning to score Tony Campana from third base, and the Chicago Cubs rallied past the Milwaukee Brewers 5-4 on Tuesday night.
The winning run capped a late comeback as Jeff Samardzija (5-2), the last of six Cubs pitchers, won his second straight game in relief.
Trailing 4-1, the Cubs scored three times in the eighth off Milwaukee reliever Marco Estrada. Castro doubled home Kosuke Fukudome, and Aramis Ramirez followed with his fifth homer, a two-run shot that tied it 4-all.
The rally spoiled a strong effort by Brewers ace Yovani Gallardo, who allowed three hits and struck out a season-high 10 in seven innings.
Campana opened the 10th with a double off Tim Dillard (1-1) and moved to third on Fukudome's sacrifice, bringing up Castro.
Milwaukee maintained a share of the NL Central lead as St. Louis lost 8-6 at Washington.
The Brewers scored twice in the third inning, sending eight batters to the plate while leaving three on base.
Rickie Weeks led off with a single and scored the first run on Ryan Braun's base hit. The Brewers then loaded the bases and scored again when Casey McGehee grounded to shortstop for a fielder's choice that brought home Nyjer Morgan.
Starting pitcher Randy Wells then walked Corey Hart to load the bases again, but escaped the inning when Yuniesky Betancourt popped up in the infield and Jonathan Lucroy flied to left.
Prince Fielder's one-out sacrifice fly in the fourth brought home Gallardo for a 3-0 lead.
Cubs catcher Geovany Soto's seventh-inning solo home run broke up the shutout bid.
Cubs manager Mike Quade used five relievers over the final three innings, including rookie Chris Carpenter, who made his major league debut in the eighth.
Weeks, who had three hits, greeted Carpenter with a double to left that scored Lucroy for a 4-1 lead.
Wells worked six innings, giving up eight hits and two earned runs. He struck out two and walked three.