CHICAGO -- - Dansby Swanson hit a tiebreaking sacrifice fly in the eighth inning, and the Chicago Cubs beat the Pittsburgh Pirates 4-3 on Sunday in the rubber game of the weekend series.

Pete Crow-Armstrong and Ian Happ each had two hits for Chicago, which had dropped four of five before a 3-1 victory Saturday.

Next up is a big five-game series against major league-leading Milwaukee, beginning with a split doubleheader Monday at Wrigley Field. The Cubs are eight games back of the Brewers in the NL Central.

Chicago had runners on second and third with one out in the eighth when Isaac Mattson (3-2) issued an intentional walk to Nico Hoerner . Swanson followed with a flyball to right, driving in Carson Kelly .

Caleb Thielbar (3-3) got one out for the win, and Andrew Kit

See Full Page