New York City is a net giver in tax money compared to the government services it receives. We generate a profit for the federal and state government. We are a cash cow - indeed, the entire point of cities (besides historic defensibility) is economic efficiency. We subsidize communities that are not self-sufficient, and indeed the entire point of a federal government is that communities that need support get support from communities that are capable of giving it.
The irony of the “by your own bootstraps” GOP doctrine is that most of the states that vote GOP (or espouse a particularly libertarian worldview) are net takers of federal funds.
But as to your original point - whether we’re a welfare state - yes, we are. But we pay for it. Even Hizzoner Bloomberg says that we pay high taxes because we want the services those taxes provide.
New York is a natural port, which means it has land masses that stop high waves from the ocean and is still deep enough to allow ships to butt right against the land without grounding. New York has a wide, navigable river, which was extended through canals to the Great Lakes. New York is mostly on top of granite, which is easy to build on.
New York’s natural port is insufficient for the largest of modern container ships, which is why major shipping interests are now in the Port of Newark/Elizabeth, dredged out from Newark bay across the Hudson from the city proper. New York is separated from the mainland by a large river, which has historically barred direct freight rail access to the country and limited intercity passenger rail, which has stagnated heavy industry within the city.
New York leads the country as an air hub, as its three airports dominate the country in both domestic and international flights, and has the best skilled labor market - and number of educational institutions - that is conveniently fed by a public transit system that moves more people than the rest of the country combined.
Effectively, while the city was made because of its natural port (and amoral economic policies when competing against Philadelphia and Boston), it keeps its position because of its infrastructure and skilled labor market.