A defendant against whom an action is pending upon a contract or for specific real or personal property may at any time before answer upon affidavit that a person not a party to the action, and without collusion with him, makes against him a demand for the same debt or property, upon due notice to such person and the adverse party, apply to the court for an order to substitute such person in his place and discharge him from liability to either party on his depositing in court the amount of the debt, or delivering the property or its value to such person as the court may direct; and the court may in its discretion make the order.
SDCL 15-6-67(b)