A career day from Jonathan Lucroy couldn't save the Milwaukee Brewers from a bullpen collapse.

Lucroy hit a grand slam and drove in seven runs for Milwaukee, but Alfonso Soriano's RBI single capped a three-run comeback in the ninth inning Thursday that lifted the Chicago Cubs to a 12-11 win.

In a seesaw game featuring a combined 15 extra-base hits, the Cubs led 3-0, trailed 9-3 and were still down 11-9 going into the ninth.

Starlin Castro hit an RBI single against Francisco Rodriguez (2-7), Anthony Rizzo tied it with his second double of the afternoon and Soriano won the game with his one-out drive off the center-field wall.

"They put up great at-bats. I give credit to them," said Rodriguez. "Castro hit a ground ball that found a hole and you know the rest."

Rodriguez walked three in the ninth, giving Brewers pitchers a total of 11 in the game.

"Walks will get you," Lucroy said. "You got to make guys hit their way on. I think the walks beat us today for sure."

Lucroy tied his career high for RBIs and Rickie Weeks had five hits. Ryan Braun and Cody Ransom also homered for Milwaukee, which had won eight straight against the Cubs.

Ransom led off the seventh with a go-ahead solo shot to center off Blake Parker after Chicago rallied to tie the game with a six-run sixth.

"Once we got the big lead and they came back we just didn't have the momentum," said Milwaukee manager Ron Roenicke.

Lucroy's third-inning shot landed on Waveland Avenue, erasing the Cubs' early 3-0 lead. Lucroy also stroked a two-run single in the sixth and an RBI single in the eighth, matching the career high of seven RBIs he set May 20 against Minnesota.

Braun's league-leading 36th homer was even more impressive, clearing the batter's eye beyond the ivy in center field and nearly hitting the camera booth.

The game capped a lopsided season series between the NL Central rivals that saw Milwaukee take 13 of 17 games. Cubs manager Dale Sveum was a coach for the Brewers before taking the reins in Chicago.

Shaun Marcum was making his second start after missing two months because of elbow soreness. He allowed three runs, scattering five hits and four walks while striking out four. Marcum had to leave the game after throwing 85 pitches because of right calf cramping but the injury is not considered serious.

"I felt it in one pitch (in the third inning) and it didn't go away," Marcum said. "I wasn't very good from the get go, wasn't locating anything. All in all, today wasn't a good day."

Carlos Marmol (2-2) picked up the win in relief.

Cubs rookie Brooks Raley gave up seven runs and 10 hits in four innings in his last outing of the season. Before the game, Sveum said that Raley would be shut down because of an innings limit.

Raley will finish the season 1-2 with an 8.14 ERA in his first five big league starts.

Brett Jackson, another rookie, reached base four times. He doubled twice in the sixth, including a slicing two-bagger up the left-field line that tied the score 9-all.

"Those young guys don't give up," Soriano said. "When we're losing like we're losing, a lot of games, you have to come to the ballpark with energy.

"We try our best. We try to play hard and win games."

David DeJesus and Luis Valbuena had three hits each for Chicago, which avoided falling 32 games under .500 for the first time since finishing the 2000 season 65-97.

NOTES: Darwin Barney played his 115th consecutive errorless game at second base, extending the single-season NL record he set on Wednesday. Barney is eight games shy of Ryne Sandberg's Cubs record for errorless games including streaks over multiple seasons. ... Sveum said LHP Chris Rusin will likely be recalled from Triple-A Iowa to assume Raley's spot in the Chicago rotation. Rusin held the Brewers to one run and one hit over five innings on Aug. 21 in his only big league appearance. ... Sveum said that Luis Valbuena may see the bulk of the action at third base going forward after prospect Josh Vitters struggled to a 5-for-53 start after being recalled from the minors for the first time.