Some things are included in the Law by way of precept; other things, as being ordained to the fulfilment of the precepts. Now the precepts refer to things which have to be done: and to their fulfilment man is induced by two considerations, viz. the authority of the lawgiver, and the benefit derived from the fulfilment, which benefit consists in the attainment of some good, useful, pleasurable or virtuous, or in the avoidance of some contrary evil. Hence it was necessary that in the Old Law certain things should be set forth to indicate the authority of God the lawgiver: e.g. Deuteronomy 6:4: "Hear, O Israel, the Lord our God is one Lord"; and Genesis 1:1: "In the beginning God created heaven and earth": and these are called "testimonies." Again it was necessary that in the Law certain rewards should be appointed for those who observe the Law, and punishments for those who transgress; as it may be seen in Deuteronomy 28: "If thou wilt hear the voice of the Lord thy God . . . He will make thee higher than all the nations," etc.: and these are called "justifications," according as God punishes or rewards certain ones justly. [ST I-II, Q99, A5]The first thing to note here is the reason for the description of the precepts as "justifications:" that is, because of the just character of the rewards or punishments God gives to those that obey or disobey. In other words, it is not that by them a man may be justified by God; rather, it is because of God's just dealings with man. Now whether St. Thomas' category here (which appears to be founded, unless I miss my guess, upon a particular word used in the Latin translation of Deuteronomy or Exodus) is still relevant is beside the point. What is relevant for this post is that he does not assign the Law any role in our justification before God.
We may see all the more clearly that this is so if we consider the rest of the discussion.
The things that have to be done do not come under the precept except in so far as they have the character of a duty. Now a duty is twofold: one according to the rule of reason; the other according to the rule of a law which prescribes that duty: thus the Philosopher distinguishes a twofold just--moral and legal (Ethic. v, 7).He makes perfectly clear what he means when he refers to the Law's precepts as "justifications:" They are "executions of legal justice," performed (as noted above) by God. Hence the law is not to be interpreted as a means by which man may justify himself.
Moral duty is twofold: because reason dictates that something must be done, either as being so necessary that without it the order of virtue would be destroyed; or as being useful for the better maintaining of the order of virtue. And in this sense some of the moral precepts are expressed by way of absolute command or prohibition, as "Thou shalt not kill, Thou shalt not steal": and these are properly called "precepts." Other things are prescribed or forbidden, not as an absolute duty, but as something better to be done. These may be called "commandments"; because they are expressed by way of inducement and persuasion: an example whereof is seen in Exodus 22:26: "If thou take of thy neighbor a garment in pledge, thou shalt give it him again before sunset"; and in other like cases. Wherefore Jerome (Praefat. in Comment. super Marc.) says that "justice is in the precepts, charity in the commandments." Duty as fixed by the Law, belongs to the judicial precepts, as regards human affairs; to the "ceremonial" precepts, as regards Divine matters.
Nevertheless those ordinances also which refer to punishments and rewards may be called "testimonies," in so far as they testify to the Divine justice. Again all the precepts of the Law may be styled "justifications," as being executions of legal justice. Furthermore the commandments may be distinguished from the precepts, so that those things be called "precepts" which God Himself prescribed; and those things "commandments" which He enjoined [mandavit] through others, as the very word seems to denote.
From this it is clear that all the precepts of the Law are either moral, ceremonial, or judicial; and that other ordinances have not the character of a precept, but are directed to the observance of the precepts, as stated above. [ST, op. cit.; emphasis added]
It's probably worth pointing out that this fact stands in no conflict with our duty as Christians to obey God. We do not obey in order to be saved; we obey because we are saved. "If you love me, keep my commandments," said our Lord (Jn. 14:15). This unambiguously sets forth our duty. Can it be said then that the man who does not obey him loves Christ? Of course not. And shall Christ save those who hate him? Of course not.
For this is the love of God, that we keep his commandments; and his commandments are not burdensome. (1Jn. 5:3).But we have strayed from our purpose. We are considering what St. Thomas says about justification, and as we have seen we are justified by Christ rather than by anything that we do ourselves. The present passage of the Summa shows us that St. Thomas assigns no place for the Law as a means by which man may justify himself. To the contrary, Christ is our life.