The 26th-ranked player was among the hot tickets in Flushing Meadows after his sensational run to the French Open quarter-finals this year, where he beat Novak Djokovic and Casper Ruud.
"After undergoing tests and starting treatment for my abdomen, it became clear to me and my team that I need more time to fully recover so I can compete at a high level," said Fonseca.
"It was not an easy decision to make, as it is a very special tournament for me. We'll keep working hard so I can come back as soon as possible."
World number one Jannik Sinner and Briton Jack Draper withdrew from the tournament last week due to injury. Former world number four Holger Rune will also miss the event.
The men's singles main draw begins on Sunday.
