MILWAUKEE (AP) Chicago was struggling before Anthony Rizzo got the Cubs back on track with one mighty swing in Milwaukee.
Rizzo hit a three-run homer with two out in the eighth inning, and lifting the Cubs to a 5-2 victory over the Brewers on Thursday night.
''The whole night, it wasn't going our way,'' Chicago manager Joe Maddon said. ''But I liked the way we worked. And then eventually Riz steps up and does what he can do.''
The Cubs won for the third time in four games since they were swept in a weekend series against lowly Philadelphia. Rizzo finished with three hits and Dexter Fowler went 2 for 4.
Jimmy Nelson pitched seven innings of two-hit ball for Milwaukee, but Chicago rallied in the eighth. Addison Russell and Fowler singled against Jeremy Jeffress before Will Smith (4-2) came in.
Smith retired his first two batters, but Rizzo connected for his 18th homer to give the Cubs a 3-2 lead. It was only the second home run allowed by Smith this season.
''Nelson pitched really well,'' Rizzo said. ''We came through there (in the eighth). We got two guys on and got the big inning. Just huge for us.''
Chicago added two runs in the ninth on Kris Bryant's sacrifice fly and Kyle Schwarber's RBI single.
Rafael Soriano (2-0) pitched a scoreless seventh, Pedro Strop retired the side in the eighth and Hector Rondon finished for his 14th save in 17 tries.
The Brewers broke through for two runs in the third against Jake Arrieta. Gerardo Parra led off with a single, giving him a career-high 14-game hitting streak. Parra stole second and scored on Jonathan Lucroy's double. Ryan Braun's infield single drove in Lucroy.
Arrieta gave up five hits in six innings. He is 5-1 with a 1.53 ERA in his last eight starts, but struggled at times with his command against the Brewers.
''When everything's crisp and all your pitches are working, those are easy,'' Arrieta said. ''Tonight was just one of those ones where things weren't as crisp as we would have liked but still good enough to keep us in the game.''
Nelson struck out eight and walked three. He also threw seven scoreless innings in his previous start at Arizona.
Maddon blamed social media for the bizarre events on Wednesday surrounding the failed trade of Carlos Gomez from Milwaukee to the New York Mets. Wilmer Flores, who would have been shipped to Milwaukee as part of the deal, got teary-eyed on the field after thinking he had been traded.
''That's kind of awkward obviously. That's just a product of today's society and technology,'' Maddon said. ''Without social media and everybody having a voice and an opinion, something like that wouldn't have happened. There are a lot of things in today's existence that make everything better. I don't think social media does.''
LET'S MAKE A DEAL
Brewers general manager Doug Melvin said don't expect his team to sit still after the non-waiver trade deadline on Friday.
''I've made a lot of pretty good deals in my career after July 31st,'' he said. ''We acquired (Jonathan) Broxton after the deadline last year.''
Cubs: C Miguel Montero continues to make progress in recovering from a sprained left thumb. Montero has been on the disabled list since July 17. ''He's very adamant that he feels really good,'' Maddon said. ''There's a lot of issues beyond just catching the baseball. There's legs to be considered, too.'' Montero likely will be sent on a brief rehab assignment. ''I know he doesn't want to do that,'' Maddon said. ... Bryant didn't start so he could rest. He hit for Arrieta in the seventh and took over at third.
Brewers: After the planned trade of Gomez to the Mets fell apart on Wednesday, Gomez was traded to the Astros prior to the start of the Thursday's game. Melvin bristled at reports that the Mets backed off from the initial deal because of concerns about Gomez's hip. ''Carlos Gomez is completely healthy,'' Melvin said. ... Milwaukee recalled OF Logan Schafer and selected INF/OF Elian Herrera from Triple-A Colorado Springs. They are expected to join the team on Friday.
Cubs: Jason Hammel (5-5, 3.20 ERA) is 6-0 with a 2.25 ERA in eight career starts against the Brewers. He faced Milwaukee in consecutive starts in May, registering a win while surrendering five earned runs over 13 innings.
Brewers: Rookie Taylor Jungmann (5-2, 2.14 ERA) will make his 10th start of the season on Friday night. Milwaukee is 6-3 in those starts. Opponents are batting .210 (43-for-205) with just two home runs against Jungmann.