When you incur legal fees to get or keep taxable income, then these fees are deductible. An exception to this would be the fees paid to a divorce attorney. A wealthy spouse cannot claim the deduction for protecting assets in a divorce.
Generally, allowable expenses related to income get deducted on Schedule A (Itemized Deductions) as Miscellaneous Subject to 2% of AGI. This means if you don't normally itemize, or if the attorney fees weren't really high, you don't get any tax benefit from them.
Keep any documentation you have on the fees and how they were paid. The IRS is quick to question this deduction.