Imam al-Shafi'i (may Allah have mercy on him) said: "There are two views on this (issue). One of them is that lots will be cast between the two of them; then the one whose lot comes out will swear that his witnesses have certainly testified to the truth, and then (the judge) will give judgement for him regarding it (the item)."
Imam al-Shafi'i (may Allah have mercy on him) said: "Sa'id bin al-Musayyib (may Allah have mercy on him) held the view of casting lots and narrated it from the Prophet (peace and blessings be upon him), and the people of Kufah narrate it from Sayyiduna Ali bin Abi Talib (may Allah be pleased with him)."
Sa'id bin al-Musayyib (may Allah have mercy on him) said: Two men came to the Prophet (peace and blessings be upon him) with a dispute. Both also presented upright witnesses. He (peace and blessings be upon him) cast lots between the two of them and said: 'Allahumma anta taqdi baynahum' (O Allah, You judge between them). Then he (peace and blessings be upon him) gave judgement for the one whose lot came out.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الدعوى والبينات / 21235