Non-Resident NJ State Income tax on sale of rental property

I live in Texas, which has not state income tax,  and I sold a rental property I have in New Jersey that resulted in a significant capital gain.  I am aware I need to file NJ State Tax.  At the time of sale (Nov) the title company withheld $9,000 for NJ state tax which is required from non-resident real estate sales, this amount was the minimum.   I did pay and additional $15,000 as an estimated tax payment to avoid a penalty for underpayment in NJ.

The question is this - Do I show the tax paid to NJ as ordinary State Income tax or is there a way to deduct it as part of the sale of the property. Rental income was negative for the year.    If I do need to show it as ordinary state income tax can I deduct the $9000 I paid in 2021 and the $15,000 I paid as an estimated tax in 2022 for 2021.  I understand deduction for state taxes is limited to 10K.