Section 6. So much of any funds known as ''Patients Funds'' as represents monies belonging to, or deposited for the benefit of, patients or members who have been discharged or voluntarily departed from, or died at, either of said Homes, which shall have remained unclaimed for more than three years, shall be paid by the commandant or superintendent thereof to the state treasurer to be held subject to be paid to the person establishing a lawful right thereto, with interest at the rate of three per cent per annum from the time when it was so paid to the state treasurer to the time when it is paid by him to such person; provided, that so much of any monies so paid to the state treasurer as may be necessary to reimburse said Home for any sum due for the support of the person by whom, or for whose benefit such money was originally deposited, shall be credited to said Home for that purpose. After six years from the date when any such monies were paid to the state treasurer the same or any balance thereof then remaining in his hands shall be transferred to the trustees of said Home for deposit in its legacy fund or legacy account. Any person, may, however, establish his claim after the expiration of the six years above mentioned and any claim so established shall be paid from the legacy fund or legacy account of said Home. Any person claiming a right to money deposited with the state treasurer or with the trustees under this section may establish the same by a petition to the probate court. A justice of said court, after examining the merits of the claim, may direct the treasurer or the trustees to pay such money to the claimant.