Cites this verse
Reply to Objection 1: A thing is said to be good in two senses: first in the sense that it is truly good and simply perfect, secondly, by a kind of likeness, being perfect in wickedness; thus we speak of a good or a perfect thief, as the Philosopher observes (Metaph. v, text. 21). And just as with regard to those things which are truly good, we find a highest cause, namely the sovereign good which is the last end, by knowing which, man is said to be truly wise, so too in evil things something is to be found to which all others are to be referred as to a last end, by knowing which, man is said to be wise unto evil doing, according to Jer. 4:22: "They are wise to do evils, but to do good they have no knowledge." Now whoever turns away from his due end, must needs fix on some undue end, since every agent acts for an end. Wherefore, if he fixes his end in external earthly things, his "wisdom" is called "earthly," if in the goods of the body, it is called "sensual wisdom," if in some excellence, it is called "devilish wisdom" because it imitates the devil's pride, of which it is written (Job 41:25): "He is king over all the children of pride."
Summa Theologiae II-II, q. 45, a. 1: Whether wisdom should be reckoned among the gifts of the Holy Ghost? Reply to Objection 1 (tr. Fathers of the English Dominican Province)