Yes. Gain from sale of property is defined as the excess of the amount realized over the seller’s tax basis (as adjusted for items such as depreciation). Loss is the excess of the tax basis (as adjusted) over the amount realized.1 The tax basis of property includes any unpaid nonrecourse mortgage liability, and on sale of the property subject to the mortgage the amount realized by the owner includes the unpaid balance of any nonrecourse mortgage on the property.2 It does not make any difference that the unpaid balance of the mortgage exceeds the fair market value of the property at the time of sale.3
Abandonment of property subject to a nonrecourse debt is treated as a sale or exchange and the amount of outstanding debt is an “amount realized” on sale or exchange for purposes of determining and characterizing gain or loss.4
1. IRC § 1001.