Unfortunately there are employers in NYC who do call previous employers to verify salary. Remember that most white-collar employees are in much less demand than developers and have to deal with far more employer bullshit.
Before you're hired? If I found out that a prospective employer was calling my current employer, I would decline to continue interviewing and tell them exactly why.
This has me thinking, if that is legal, what is to stop any old random person who wants to know what you make from calling your employer posing as a recruiter/hiring manager looking for current salary?
I've had prospective employers call for reference/jobs description check and ask this question. It's really easy to not answer, or to answer "market rates".