When it is desired to have returned to this state a person charged in this state with a crime and such person is imprisoned or is held under criminal proceedings then pending against him in another state, the governor of this state may agree with the executive authority of such other state for the extradition of such person before the conclusion of his term of sentence in such other state, upon condition that such person be returned to such other state at the expense of this state as soon as the prosecution in this state is terminated.
N.Y. Crim. Proc. Law § 570.12