When you live in one state and work in another state, you prepare a non-resident state tax return for the state you work in, then prepare a return for the state you live in. So--prepare a non-resident New York return first, then prepare your PA return.
https://ttlc.intuit.com/questions/2895920-why-would-i-have-to-file-a-nonresident-state-return