The deal, which was officially announced Thursday, includes a club option for 2021.
Between the two teams, the right-hander made 41 appearances, going 2-1 with a save and a 3.41 ERA. The seven-year veteran is 32-34 with six saves and a 3.86 ERA in his career.
The Brewers' addition of a reliever from the Cubs comes after Chicago signed a former Brewers reliever, adding Jeremy Jeffress on a one-year deal.
The Brewers designated right-hander Deolis Guerra for assignment. The 30-year-old Guerra pitched in one game for Milwaukee last season, and previously played for the Pittsburgh and the Angels.
ESPN's Jesse Rogers and The Associated Press contributed to this report.