If you earned all your wages in New York, you will pay tax in both New York and New Jersey on this income. There is no allocation of your wages required. You must pay NY because you earned income in the state and you must pay NJ because you are taxed on your world-wide earned income.
However, you will exclude from New York state all other types of income- interest, dividends, capital gains. You are only taxed by New York on the income you earned in the state.
You will also receive a tax credit from New Jersey for the taxes you paid on your New York wages. Just make sure you complete your NY Non-Resident before your NJ Resident tax return.
For more information, see these links:
NJ Resident
Tax Returns
NY Non-residents