Any time a new job is created somewhere, regardless of whether or not it is filled by someone who was already local or not, the total number of available jobs + filled jobs goes up, as long as positions are backfilled. Positions usually are backfilled.
So even if every person that works at Amazon NYC already lived in NYC, they will have left 25,000 other jobs that are now available.
There are a few ways in which these previous jobs get backfilled:
1) More people moving around locally. This will generally increase the pressure for local businesses to keep their employees happier, to prevent the attrition. This will generally increase the pressure for the businesses looking to hire to also compete. The easiest way both parties do this is increasing salary - which increase tax revenue. Other ways are other employee perks, which might not directly result in more tax revenue, but should result in increased QoL for the employees.
2) People moving into the city. People move to where the jobs are. People moving directly increases tax revenues, because they're increasing the tax base. If they're not moving in large enough quantities to fill all the open positions, then again, companies have to do something to increase their attractiveness. Since this is usually increasing pay, when it gets high enough to attract someone to move it then is an even larger effect.
3) People coming of age for work that already lived there/graduating college there/etc. They might already reside in the city, but weren't part of the workforce. They'll need jobs, and again, a market that is competing for employees is one where employers have to differentiate themselves.
NYC doesn't need the Amazon jobs to be filled by people moving to the city for it to be an economic win. They just need to have properly balanced tax incentives/breaks vs. the benefit achieved from these factors. I'm not an expert so I don't know if they've successfully done that, but there's no reason to think that this being successful is dependent on Amazon directly bringing in people from out of city/out of state.
As long as this is allowed nationally, cities and companies are being rational actors in trying to make these sort of deals. It doesn't mean that they always work out (See: Wisconsin, Foxconn, as mentioned repeatedly), but it is certainly possible for a deal to be created that is mutually beneficial to the company and the locale.