Live in NY, but work in NY and NJ. NJ nonresident Portion Taxed by New Jersey - how to report state tax in NY and NJ

I live in NY for the whole year and  work for the first company in NY and the second company in NJ. 

 

For example:

company 1 state tax: NY 5,000

company 2 state tax (2 W2s for the same company): NY box 16 is 12,000 

                                                                                               NJ box 16 is 13,000

 

When I filed NY resident, 'Taxes Paid to Another State' asked about income taxed by New Jersey. The New York Salary shows 17,000 (=5,000 + 12,000). What number is 'Portion Taxed by New Jersey'? should it be 13,000 or 12,000? Thanks.