How to avoid being double taxed in NJ in TurboTax when I sold my rental house property in MA?

I sold my rental property in MA in 2023, MA is taxing me for the capital gain.  I am living in NJ as a full-year resident in 2023.  I am taxed by NJ for the capital gain made from this house sale in MA. In the past, I worked in 2 states in the same year, NJ only taxed the income that I made in NJ, but not from the other state.

May I ask how do I do in TurboTax to remove this double taxed capital gain from the NJ tax return?