The Cubs are acquiring utility player Zach McKinstry in return.
The Dodgers' bullpen has been shaky at times and dealing with a number of injuries this season, including losing top setup reliever Daniel Hudson to a season-ending torn left ACL as well as injuries to Blake Treinen and Tommy Kahnle.
Even so, the Dodgers entered Sunday with the sixth-best ERA from their bullpen in the majors at 3.37. And they hold a five-game lead over the New York Mets for the best record in the National League.
Martin, 36, signed a one-year contract with the Cubs in March and had a 1-0 record and 4.31 ERA in 34 appearances this season. He has played in seven major league seasons with the Colorado Rockies, New York Yankees, Texas Rangers, Atlanta Braves and Cubs. He also played two seasons in Japan in 2016 and 2017.
McKinstry, 27, hit .091 with one home run and two RBIs in 10 games for the Dodgers this season.