Application for such a discharge must be made by petition, addressed to the court from which the execution issued; or to the county court of the county in which he is imprisoned; or, if he is imprisoned in the city of New York, to the supreme court.
N.Y. Debt. and Cred. Law § 121