All liens arising under this division, except in favor of the original contractor, shall stand on an equal footing, and be first paid out of the proceeds of the sale of the property, or money collected from the owner or proprietor; and if such proceeds and money are insufficient to satisfy such liens in full, the same shall be distributed pro rata among the holders thereof; but no person shall be entitled to participate in such distribution until he has obtained judgment establishing his lien.