NYC does this thing where they either get teachers from locals or they import. The import thing is interesting. They basically steal young teachers with advanced degrees from Texas, California, etc. set them up with an apartment to get them started out, and put them into low performing schools. So, the teachers go from earning $25,000 to about $50,000. After about five or ten years, those teachers leave to work in the suburbs, where their salary jumps from $50,000 or $60,000 to $80,000 or $90,000.
The same thing happens with cops, as well. They put in a couple years and leave for the burbs fully trained.
On the other hand, there are NYC teachers who become "addicted" to the action. I know a few.
So NYC becomes the training ground that provides the experience for the larger NJ salaries. I've seen some reports of what teachers in NJ earn--it makes ours here in VA pale! In my county, a teacher with Masters + 30 will earn close to 80K after 30 years of service. I've been told that teachers in NJ top that level after about 1/2 the time. Of course I teach in a rural county, in a safe school, so maybe the trade off is worth it.