This is a crazy situation that I realize we may have screwed up when we originally did it, but I'm hoping it can be salvaged. My husband and his sister inherited a house (I'll call X) in 2003. My husband was named trustee of his father's Living Trust. The trust stated that siblings would get equal ownership in house X. We didn't sell it immediately because relatives were living there. It became rental property in 2009. His sister ran into some financial difficulties so we bought her a house (call it Z) in 2013. (Not to go too far into the weeds, but they didn't want soon-to-be ex-husband to try to take sister's property if it were hers.) The agreement was that she would eventually pay us back. She wasn't able to manage repayment, so we gave house Z to her in exchange for 100% ownership of the inherited house X. House X was then transferred out the trust and into our names. The house continued to be rented until 2023. We spent all of 2024 getting house X suitable for sale. Say that the house X was valued at $100,000 in 2003 and sold in 2024 for $200,000. We paid $50,000 for his sister's property Z in 2013 which could be looked at as buying her half of house X. Is there any way we can deduct that from our capital gain on the sale of X in 2024?