Under the regulations (IRS Reg. Sec. 1.262-1(b)(7)), legal and other professional fees incurred in connection with a divorce, separation or decree for support by either party are not deductible. Legal expenses, however, incurred by either party in collecting alimony or support payments are deductible under IRC Sec. 212 if the income is taxable.
Legal fees incurred to obtan clear title to property are generally capitalizable into your cost basis. Attorneys' fees paid in a suit to quiet title to lands or property are not deductible; but if the suit is also to collect accrued rents thereon, that portion of such fees is deductible which is properly allocable to the services rendered in collecting such rents.
Sorry. Only the portion of your fees allocable to collecting taxable income from your ex-husband will be deductible.
Because it is impossible for me to identify and consider ALL the relevant facts, this advice is not intended or written to be used for the purpose of avoiding penalties, and cannot be used for that purpose.