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)."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الدعوى والبينات / Q21235