Deductions & credits

IRS Publication 523 Selling Your Home - https://www.irs.gov/pub/irs-pdf/p523.pdf#page=17

There is no tax deduction for transfer taxes, stamp taxes, or other taxes, fees, and charges you paid when
you sold your home. However, if you paid these amounts as the seller, you can treat these taxes and fees as selling expenses. If you pay these amounts as the buyer, include them in your cost basis of the property.