You are probably looking for the words ἐπιείκεια and γνώμη. The former word is often translated "equity" and is described by Aristotle in Nicomachean Ethics, bk. 6, ch. 10 as a sort of correction to a universal rule or law that is in keeping with the spirit of the law. Plato had discussed a case in which the law might need correction in his Republic when talking about whether it is just to return someone's sword if that person has gone insane. This is a paradigmatic case calling for equity. In Nicomachean Ethics, bk. 7, ch. 11, Aristotle describes γνώμη as the intellectual capacity helping one to make equitable judgments.
Latin authors such as Cicero were clearly aware of this notion. For instance, he states that you should not return the sword to the insane person in De Officiis, bk. 3, n. 95:
Si gladium quis apud te sana mente deposuerit, repetat insaniens, reddere peccatum sit, officium non reddere.
With the recovery of Aristotle in the Latin west in Medieval times, these issues were again discussed by Aristotle's scholastic followers such as Thomas Aquinas. Aquinas notes that the term ἐπιείκεια corresponds to the Latin word aequitas in the following passage from his Summa, II-II, q. 120:
. . . Et ad hoc ordinatur epieikeia, quae apud nos dicitur aequitas.
Aquinas also discusses γνώμη but does not indicate a Latin equivalent.