Belfort, 40, confirmed the planned matchup via Instagram, following an initial report by MMAFighting.com. The UFC 224 pay-per-view event is scheduled to take place at Jeunesse Arena.
"May 12, [Machida] and I will step into the Octagon as professionals and we (sic) still be friends," Belfort wrote. "Always respecting each other, and the way we will do that is giving our best in the Octagon."
Belfort (26-13) has stated this is the last fight of his contract. Earlier this year, the veteran announced he planned to retire following a bout against Uriah Hall on Jan. 14, but Hall was forced out of the fight at the last minute due to complications during his weight cut.
Belfort is coming off a decision win over Nate Marquardt last June. Prior to that, he had been knocked out in four of his last five fights.
Machida, 39, earned a split decision win against Eryk Anders earlier this month. The former light heavyweight champion sat for more than two years between 2015 and 2017, due to an 18-month drug suspension.
Now fighting out of Los Angeles, Machida is 1-1 since returning from suspension and 23-8 overall. He suffered a first-round knockout loss to Derek Brunson in October.