When either husband or wife is mentally incompetent and incapable of executing a mortgage relinquishing or encumbering his or her right to the homestead or any other real property of the other, the other may file a complaint in the district court of the county of his or her residence or of the county where the real estate to be encumbered is situated setting forth the facts and praying for an order authorizing the applicant or some other person to execute a mortgage and relinquish or encumber by such mortgage the interest of the mentally incompetent person in such homestead or other real estate. The court shall not authorize the execution of any mortgage on the homestead of the parties for an amount greater than is necessary to pay or redeem the lien of an existing mortgage on such homestead.