The sheriff or other officer to whom a writ of execution under section 2A:50-36 of this title shall be directed and delivered shall make sale pursuant to the command of such writ, and shall make and execute a deed or deeds for the premises sold, as the case may require; but no greater estate in the premises sold shall, at any time, be granted to a purchaser than would have been vested in the mortgagee had the equity of redemption been duly foreclosed.
The moneys arising from a sale pursuant to this section shall be applied to pay off and discharge the moneys ordered to be paid, and the surplus, if any, shall be deposited with the court and the same shall be paid to the person or persons entitled thereto, upon application therefor, as the court shall determine. Such surplus moneys may be invested at interest on such security as the court shall order pending application therefor by the person or persons entitled thereto. All charges in connection with applications for surplus moneys not exceeding $100, shall not exceed the sum of $5.
N.J.S. § 2A:50-37