New York Grandparent Visitation – Domestic Relations Law § 72
1. Where either or both of the parents of a minor child, residing within this state, is or are deceased, or where circumstances show that conditions exist which equity would see fit to intervene, a grandparent or the grandparents of such child may apply to the supreme court by commencing a special proceeding or for a writ of habeas corpus to have such child brought before such court, or may apply to the family court pursuant to subdivision (b) of section six hundred fifty-one of the family court act; and on the return thereof, the court, by order, after due notice to the parent or any other person or party having the care, custody, and control of such child, to be given in such manner as the court shall prescribe, may make such directions as the best interest of the child may require, for visitation rights for such grandparent or grandparents in respect to such child.
2. (a) Where a grandparent or the grandparents of a minor child, residing within this state, can demonstrate to the satisfaction of the court the existence of extraordinary circumstances, such grandparent or grandparents of such child may apply to the supreme court by commencing a special proceeding or for a writ of habeas corpus to have such child brought before such court, or may apply to family court pursuant to subdivision (b) of section six hundred fifty-one of the family court act; and on the return thereof, the court, by order, after due notice to the parent or any other person or party having the care, custody, and control of such child, to be given in such manner as the court shall prescribe, may make such directions as the best interests of the child may require, for custody rights for such grandparent or grandparents in respect to such child. An extended disruption of custody, as such term is defined in this section, shall constitute an extraordinary circumstance.
(b) For the purposes of this section “extended disruption of custody” shall include, but not be limited to, a prolonged separation of the respondent parent and the child for at least twenty-four continuous months during which the parent voluntarily relinquished care and control of the child and the child resided in the household of the petitioner grandparent or grandparents, provided, however, that the court may find that extraordinary circumstances exist should the prolonged separation have lasted for less than twenty-four months.
(c) Nothing in this section shall limit the ability of parties to enter into consensual custody agreements absent the existence of extraordinary circumstances.