The Spanish capital scored 5 percent of the votes in a survey carried out by Boston Consulting Group and employment website totaljobs.com.
London was chosen as the most desirable work destination in the world with 16 percent of the votes taken from 200,000 people in 188 countries.
New York came in second, Paris third, then Sydney, Madrid and Berlin.
Barcelona made it into sixth place, meaning Spain is the only country with two of its cities in the top ten.
“Madrid is the best human capital in the world,” argues relocation expert Pierre-Alban Waters, who runs the company Moving2Madrid.
“It has the good sides of a capital city – it’s modern, it has culture and more jobs than elsewhere in Spain – minus the stress, expense and unfriendliness of somewhere like Paris or London.
“Sure there are other cities where you can make more money but you won’t have the unique work-life balance that Madrid enjoys.
“Barcelona is much the same although it’s a more international city, good in that’s it’s more cosmopolitan but bad in that it has more tourists.”
As for country specific data, the US is the country where the biggest number of foreigners surveyed would be willing to work (42 percent), followed by the UK (37 percent), Canada (35 percent) and Germany (33 percent).
Spain came in eighth place in the potential work destination rankings with 26 percent, above countries such as Italy (25 percent) and Sweden (23 percent).
According to the study, one in every five participants already has international work experience, and almost 64 percent said they would be willing to go to another country for work.