N.Y. Criminal Procedure Law § 560.10
1. When a criminal action is pending against a defendant who is confined in an institution within the state pursuant to a court order issued in a different action, proceeding or matter, the following courts and judges may, under the indicated circumstances, order that the defendant be produced in the court in which the criminal action is pending for purposes of arraignment or prosecution therein: