Deductions & credits

I believe that in this case, the legal fees may be an adjustment to your cost basis, and may reduce your capital gains tax whenever you sell.  But they are not current tax deductions. (Legal fees that you pay to defend your ownership of the home are an adjustment to basis, but legal fees connected with getting a new loan or replacement mortgage are not deductible.)

 

For more about capital gains and your cost basis, see publication 523. 

https://www.irs.gov/pub/irs-pdf/p523.pdf