Generally, if you lived in New Jersey for all 2017, yes, you would enter zero since you did not live in New York.
If you lived in New York partially in 2017, you would take the deduction and divide it by 12 (months) and then multiply it by the number of months you lived in New York to get the number to enter.
However, if the deduction is related to your work in New York, then allocate it based on the percentage of the income you earned in New York vs. New Jersey.