If you are a nonresident, working in NY, you must file and pay taxes to NY on your in-state income. Deductions, if any, will be limited to NY deductions.
As your state of residence, PA reserves the right to tax all of your income, derived from any source. However, PA will generally grant a tax credit to offset the effects of the income tax paid to other states.
It is recommended that you complete your nonresident (NY) tax return first, after your federal return, then complete your resident state return last, so that the credit for out-of-state taxes paid might be correctly calculated.