Whenever, on any indictment or accusation, there is an acquittal, the sheriff of the county in which the trial was had shall pay the fees of the witnesses and constables, taking receipts from them for such payments. On the production of such receipts, or upon the oath of the sheriff, the amounts so paid shall, on demand, be repaid to the sheriff by the county treasurer from any moneys in his hand belonging to the county, and such payments shall be allowed to the county treasurer in the settlement of his accounts.
N.J.S. § 2A:166-8