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
**Disclaimer: Every effort has been made to offer the most correct information possible. The poster disclaims any legal responsibility for the accuracy of the information that is contained in this post.**