MILWAUKEE -- Anthony Rizzo hit a three-run homer with two out in the eighth inning, and the Chicago Cubs beat the Milwaukee Brewers 5-2 on Thursday night.

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.

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.

Nelson struck out eight and walked three. He also threw seven scoreless innings in his previous start at Arizona.

The Cubs put two runners on in the seventh but Nelson struck out Bryant swinging to end the inning. Nelson yelled and pumped his right arm as he left the mound to a loud ovation.