The USA is the richest country in the world despite many other countries having less inequality. Inequality isn't a measure of absolute wealth. Also isn't NYC home to the most millionaires in the world? That probably skews measures of inequality (that said it is famous internationally for having terrible poverty as well as wealth).
Why is the wealth to count "the richest" measures only by the net worth of the richest in the city and not by some other more sensible measure? If I were to find myself in what's allegedly the richest city in the richest country I would be shocked to see even a single homeless person, let alone trash and rats everywhere. I think the word "richest" is being used weirdly or perhaps even incorrectly to describe NYC.