N.Y. Not-for-Profit Corporation Law § 555
(c) If a particular purpose or a restriction contained in a gift instrument on the use of an institutional fund becomes unlawful, impracticable, impossible to achieve, or wasteful, the court, upon application of an institution, may modify the purpose of the fund or the restriction on the use of the fund in a manner consistent with the purposes expressed in the gift instrument. The institution shall notify the donor, if available, and the attorney general of the application, and the attorney general and such donor must be given an opportunity to be heard. (d)(1) If an institution determines that a restriction contained in a gift instrument on the management, investment, or purpose of an institutional fund is unlawful, impracticable, impossible to achieve, or wasteful, the institution, ninety days after notification to the attorney general, may release or modify the restriction, in whole or part, if:
(e) For purposes of this section, an institution may apply to the following courts to release or modify a restriction contained in a gift instrument: