Reference for Makkot 4:5
אמר עולא רמז לעדים זוממין מן התורה מנין רמז לעדים זוממין והא כתיב (דברים יט, יט) ועשיתם לו כאשר זמם אלא רמז לעדים זוממין שלוקין מן התורה מנין דכתיב (דברים כה, א) והצדיקו את הצדיק והרשיעו את הרשע (דברים כה, ב) והיה אם בן הכות הרשע משום והצדיקו את הצדיק והרשיעו את הרשע והיה אם בן הכות הרשע
R' Ulah said Where is there a hint to the laws of false witnesses in the Torah? A hint to the laws of false witnesses?? It is written [explicitly] And you shall do to him as he plotted... No, a hint for the forty lashes It is written And you shall exonerate the innocent and condemn the guilty and if the wicked deserves to be beaten because they [the court] exonerated the innocent party and they condemned the guilty party (in a case of civil dispute), the guilty deserve to be beaten?