Surah Al-Ma'idah, ayah 107

5:107

فَإِنۡ عُثِرَ عَلَىٰٓ أَنَّهُمَا ٱسۡتَحَقَّآ إِثۡمٗا فَـَٔاخَرَانِ يَقُومَانِ مَقَامَهُمَا مِنَ ٱلَّذِينَ ٱسۡتَحَقَّ عَلَيۡهِمُ ٱلۡأَوۡلَيَٰنِ فَيُقۡسِمَانِ بِٱللَّهِ لَشَهَٰدَتُنَآ أَحَقُّ مِن شَهَٰدَتِهِمَا وَمَا ٱعۡتَدَيۡنَآ إِنَّآ إِذٗا لَّمِنَ ٱلظَّٰلِمِينَ ١٠٧

Fa in 'uthira 'alā annahumastahaqqā ithman fa'ākharāni yaqūmāni maqāmahumā minal-ladhīnastahaqqa 'alayhimul-awlayāni fayuqsimāni billāhi lashahādatunā ahaqqu min shahādatihimā wama'tadaynā innā idhal laminaz-zālimīn

But if it is found that those two were guilty of sin [i.e., perjury], let two others stand in their place [who are] foremost [in claim] from those who have a lawful right. And let them swear by Allāh, "Our testimony is truer than their testimony, and we have not transgressed. Indeed, we would then be of the wrongdoers."