A great question given that it is my favorite city!
One way to answer this question depends is to look at who is buying it and why. Some possible scenarios below (First 2 assume that it will continue to remain a part of the US)
1. US needs a bailout and NYC is being sold as collateral
In this case you would look at the revenues that NYC brings - easiest is to start with all the taxes it collects from businesses and make assumptions on any changes to that going forward
Then look at all the expenses (e.g., subway, debt financing, public services) and see what is absolutely essential and what may perhaps be cut
Use the above to calculate a DCF and arrive at an NPV for the city
2. NYC is up for sale to the highest bidder
Here - NPV is less relevant. You can now look at the value of NYC to various types of buyers (investors, countries, alines from outer space) from what is the highest potential bid you can have. For example if only single member states are allowed to bid vs collection of countries and if there are any exclusionary criteria (e.g. only select list of countries). A single country can afford lets say 50% of one year's GDP, many countries can afford more etc. There is no end to the permutations here
3. People of NYC are tired of being part of the US and want to form their own country
Now you have to assess the value of NYC to the country. For this you will evaluate the DCF as before but also make other assumptions - for example what is the value NYC brings as the financial capital of the world, what about the prestige and media value of NYC and may other scenarios such as loss of related taxation if US loses NYC.
Additionally - there is now a higher cost of being NYC. US can impose taxes on doing business with other states, importing food and essential resources is more costly and this raises the expenses of being an island city. It will also need the US to protect it in the case of threats which will come at an additional cost.
As you can see there are many ways to play around with this question, start with the scenario and build out a structure that makes sense