Aquinas, of course, accepts the doctrine of the mean, at least for intellectual and moral virtues. Let's set the intellectual virtues aside for a moment and focus on the moral virtues. The doctrine of the mean indicates that a virtue lies on a mean, determined by right reason, between excess and defect; thus each moral virtue is opposed by at least two vices, one of excess, one of defect. I say "at least" because Aquinas is very clear in a number of cases that a virtue can be opposed by multiple vices of excess or defect that each involve some excess or defect merely of some aspect of what is involved in the virtue. To take an example, magnanimity has at least three distinguishable vices that oppose it by excess: presumption, ambition, and vainglory. Presumption exceeds the mean of magnanimity by going beyond what is appropriate to one's ability; ambition exceeds it by excessive attention to honor, which is the material, so to speak, of magnanimity; and vainglory exceeds it by excessive desire for glory, another form of material for magnanimity.
However, there are vices identified by Aquinas whose relations to virtues are slightly harder to pin down. These are vices by simulation: vices that oppose virtues by falsely resembling them. One of his examples is pride, which is directly opposed, by excess, to the virtue of humility. It is also, however, opposed to magnanimity by being a mere simulacra of it. What this appears to indicate is that, just as a single virtue may oppose several vices by excess or by defect, depending on the aspect considered, so too may a single vice of excess (or defect) may oppose more than one virtue and more than one vice of defect (or excess). Pride is the vice of excess for humility, because it exceeds reasonable bounds, and the vice of excess for magnanimity, because it seeks great things in an excessive way. These two oppositions are not equally relevant for understanding pride; St. Thomas is clear that pride is more properly and directly opposed to humility than to magnanimity. So there are at least two kinds of opposition by excess or by defect: direct opposition and opposition by false appearance, which in cases of excess occurs (I think) when a vice opposes a virtue not by exceeding the rational bounds of its activity but by exceeding the way its activity is done (mutatis mutandis, things are the same for cases of defect).
Actually, of course, there is a sense in which every vice, directly or indirectly, opposes every virtue, either by excess or defect of something essential to that virtue, or by excess or defect of something helpful to it. And the virtue of prudence, to which all vices are opposed insofar as they are moral disorders, throws an additional complication into the mix, because in a sense every other virtue is merely a potential part of prudence -- that is, every other virtue presupposes prudence in some way or other, so that in a way what is involved in a virtue is not virtuous at all, being merely material for virtue, unless it is given shape and form by prudence. It is the form of the moral virtues. Charity throws in an additional complication by being the form of the virtues in yet another way; and so, too, charity opposes all vices.
There is more involved in the doctrine of the mean than one might at first think.