Costa (13-1) was scheduled to headline UFC Fight Night on Aug. 21 but will no longer appear on the card, sources said. Kelvin Gastelum (17-7) has agreed to step up in his place and will now face Cannonier (13-5) in the five-round fight, according to sources.
The UFC has not officially announced a location for the event.
It's the second time this year Gastelum, 29, has agreed to step into a main-event slot as a replacement, and both times it was after Costa pulled out. Costa, of Brazil, was supposed to face Robert Whittaker in April but withdrew due to illness. Gastelum took his spot and lost to Whittaker via unanimous decision.
Gastelum, who has lost four of his past five, commented on the bout via social media on Friday.
"Starting over is not easy but not impossible," he wrote on Instagram. "'Once more unto the breach, dear friends, once more.'"
Cannonier, 37, has not fought since a five-round decision loss to Whittaker last October. Before that, Cannonier had worked his way into title contention with three consecutive wins over David Branch, Anderson Silva and Jack Hermansson.