True, New York's courts will almost always honor the parties' choice of which state's law should govern any dispute arising out of their agreement. As a practical matter, that means it behooves you to make sure that you can live with the state's law that is set forth in the agreement, because as noted elsewhere, when it comes to non-compete agreements, for example, the states' laws vary rather widely.
So, what can you do it you've previously signed an agreement that contains a choice of law provision that you're very unhappy with, and the other side to the agreement is pushing to apply that unfavorable jurisdiction's laws?
Youre not necessarily out of luck - although neither of the two primary options is easy to prove.
One option to circumventing the choice of law provision is that the choice of that other jurisdiction's laws can't be out of the proverbial hat; it must have some tangible relationship to the parties and/or the agreement at issue; the other option is demonstrating that the other jurisdiction's law offends New York State's public policy.
A word of caution is warranted:
In order to avail yourself of this exception to the general rule favoring choice of law provisions, you need to actually show that the proposed law not only conflicts with New York law, but that it violently collides with New York principles.