You shall neither side with the mighty to do wrong—you shall not give perverse testimony in a dispute so as to pervert it in favor of the mighty. (JPS 1985)
You are not to go after many to do evil.
And you are not to testify in a quarrel so as to turn aside toward many—[and thus] turn away. (Everett Fox, 1995)
Thou shalt not follow a multitude to do evil; neither shalt thou bear witness in a cause to turn aside after a multitude to pervert justice. (JPS, 1917)
Do not follow the majority if in your opinion their decision is wrong, neither shall you refrain from expressing your view on a case when a majority wants to decide differently. If the majority is doing what is right, follow the majority. (Charles Kahane, 1963, after Onkelos, the ancient Aramaic translation/commentary)