I work in NYC, and moved from NYC to NJ during the year. At some point during each state form, it asks me to complete the other state's return first. What do I do?

If I go through the NJ forms, there's a section about credit for taxes paid to another state, and it says I can do it right away if I've already completed my nonresident return, but that otherwise I should skip it and come back later. (Technically I don't have a nonresident NY return, I have a part-year resident return, so maybe that's part of the problem.) However, the NY return also has a section for credits for taxes paid to another state, and it says I should complete the other state's first and come back.

I have no idea which order to actually do them in, or how to handle the section for other state tax credits in the one I do first. I don't really know how NY and NJ's tax credits are supposed to work (i.e., I don't have a sense of how much money is supposed to go to each state, or how local NYC taxes factor into this), so I'm having trouble guessing about how it's supposed to work.

Any advice would be much appreciated, thanks!