Where a person has been arrested by virtue of an execution issued upon a judgment of fifty dollars or under, and has been kept imprisoned at the expense of the county for six months or over, the court out of which the execution issued may, on the application of a taxpayer of the county to which the support is chargeable, and upon due proof of the service upon the person in whose favor such execution was issued, of a notice in writing of the time when and the place where such application is to be made, at least eight days before the making thereof discharge the prisoner, and it shall be the duty of the sheriff to forthwith release him from custody.
N.Y. Debt. and Cred. Law § 139