In many jurisdictions the transfer tax can be set off against tax
liabilities. Especially in Germany if the property is rented or is utilized
commercially by the owner. It can't be set off however, if the property
is used as private home by yourself or someone closely related to you.
If the property is rented, then, in Germany, they have to be reported
under the section "income from rent and lease" (Einnahmen aus Vermietung
und Verpachtung, Anlage V) in the annual tax declaration.
The transfer tax is part of the acquisition costs when buying a property
and is added to the purchase price. This total amount can be depreciated
over the years and the annual tax-deductible amount is set off as expenses.
If the property is used commercially by the owner, then, in Germany,
the acquisition costs can be depreciated over the years as operating
expenses depending on the underlying accounting standards.
In the case where only some part of the property is rented the
acquisition costs can be deducted proportional to the ground area involved.