If you litigate with your landlord and reach a settlement under which you will pay what you agree you owe, it does not automatically make you liable for the landlord's legal costs. Unless you agree to it outside of the court's ruling, only the court can award payment of legal fees. Until this has happened, you can't be forced to pay for the landlord's lawyer. However, this won't stop some landlords, or their attorneys, from attempting to collect attorneys fees from you without a court order. Depending on the facts of your case, these attempts might violate certain Fair Debt Collection laws. It would be to your benefit to consult a lawyer about potential remedies available under these provisions, and what additional legal leverage you may have to help achieve a settlement.
Attention New York City Tenants: Get more information on Landlord Tenant matters at the McAdams Law main site here.