for the non-resident of New york state, do i enter only the w-2 for the income that was earned in New york state which was from oct to dec of last year

We live in MA but my husband started to work for a company based in NY in October of last year. We eanred income in MA from Jan-October then from October to December income from the NY based company. When completing the non resident NY state tax from, do we only input the income from the W-2 that was earned in NY state?