If only I had a dollar for every time I've been asked this question ...
New York follows what is called the "American Rule," which means that each party must bear its own costs and legal fees that arise out of the litigation process. Therefore, even if you win a breach of contract case outright, you won't be able to recover those costs from the losing party.
There are two exceptions to that rule. The first is a very minor one: there are some statutory fees that you are permitted to recover, and those are set forth in Article 82 of New York's Civil Practice Law & Rules. Typically, and unless an appeal was involved, these fees will amount to less than $1,500.
There is a second exception that can have real teeth - and therefore consequences - though:
if the parties had previously agreed to it by contract.
To that end, there is one context where such a provision has been increasingly found - and that is in employment agreements. These clauses are frequently paired with mandatory arbitration clauses that strongly favor the employer, and are designed to make it extremely difficult for the employee to sue the employer for wrongful termination or breach of the employment agreement - that is, assuming the employee is not an at-will employee. (For more information on this last topic, please see 3 Reasons Why Your Employment Agreement May Be Worthless.)