Your W-2 is correct. There is a form you need to use for NY tax return that allocates income to NY based on number of days working there. Here it is
Essentially NY taxes you on a share of your federal W-2 income, that share made up of the relative amount of working days you spent in NY.
I have several clients that work a few weeks a year in NY and we have to deal with this form for each of them.
This post was edited on 6/11 at 2:55 pm