The deal, which was announced Monday, includes the Magic sending Memphis the draft rights to Tyler Harvey, a 2015 second-round pick.
The Grizzlies will save on salary and luxury tax with the deal, dropping them $473,000 below the luxury tax.
Martin was the 25th overall pick in the 2015 NBA draft and averaged a career-best 7.7 points and 4.4 rebounds last season. He started 36 games for Memphis.
Orlando obtained Johnson in a deal with the Oklahoma City Thunder last week.