Building on Brazilian assistance programs to lift Cuban farm yields, Brazilian soybean and rice farmers are also emerging as top suppliers of food to Cuba.

But Brazil’s top project in Cuba is the $900 million upgrade of the Port of Mariel by the construction giant Odebrecht, the same company that has carried out various infrastructure projects in South Florida.

While Washington’s prolonged economic sanctions prevent most American companies from doing business with Cuba, Brazil’s efforts to gain a foothold in Cuba come at a time when the island’s economic relations are in a state of flux.

Venezuela remains Cuba’s top benefactor, but it is unclear whether Venezuela can sustain such largess as it confronts economic troubles of its own. Venezuela and Cuba recently delayed a $700 million nickel venture, and talk of other cooperation projects has died down. At the same time, Chinese exports to Cuba have climbed sharply. Chinese tourist buses can be seen outside big hotels, Chinese-built Geely cars have become de rigueur for Cuban officials and thousands of students studying the Spanish language fill hostels and Havana’s tiny strip of Chinese-Cuban restaurants.

Brazil’s profile within Cuba remains far more subtle, but the arrival of thousands of Cuban doctors, many of whom are black, has made a big splash here, shaking Brazil’s medical establishment and revealing some painful tensions over race and privilege. “These doctors from Cuba are slave doctors,” said Wellington Galvão, director of the physicians union of Alagoas in northeast Brazil, repeating an assessment of the project by critics who contend that the conditions faced by the Cubans in Brazil are degrading.

Under terms of the program, which is managed in part by the Pan American Health Organization, the Cubans are not allowed to bring their families to Brazil and receive only a fraction of their monthly salary of about $4,255. The rest is paid to Cuba’s government, providing it with a new source of hard currency.

Supporters of the project in Brazil retort that the description of the Cuban doctors as slaves is a sign of thinly veiled racism and class bias among the medical establishment. Ms. Rousseff herself has lashed out at what she called “prejudice” against the Cubans.