The notion of "good works" comes up multiple times in the New Testament, so I'll limit my answer to the meaning of "works of the law" in Paul's epistles, particularly Galatians. The NPP soteriological system is really just an implication of the NPP's textual interpretation of "faith" and "works" in Paul's epistles. Surprisingly, Catholicism (especially Thomist) and traditional Protestantism are closer to each other than they are to NPP on this point.
NPP proponent James Dunn in The Theology of Paul the Apostle (Grand Rapids: Eerdmans, 1998) defines "works of the law" as "what the law required of Israel as God’s people. Works of the law, in other words, were what Israel’s righteousness consisted of, Israel’s part of the covenant which Yahweh had made with Israel in first choosing Israel as his special people.... 'Works of the law' is the Pauline term for 'covenantal nomism.'"
Thus, the New Perspective on Paul sees "the works of the law" as being sociological. But it does not on this basis reject "the works of the law!" Instead, it sees the close connection between sociology and soteriology in 1st century Judaism as a good thing. According to NPP, the problem with the Judaizers is that their sociology was wrong, and so their soteriology was wrongly nationalistic instead of internationalistic. According to Wright, the problem with "the works of the law" was not that they were a system of works-righteousness, but "they are the things that divide Jew from Gentile" (Justification, p 117).
In contrast, both Aquinas and the Protestant Reformers viewed Paul's opponents as rejecting the Gospel by teaching works-righteousness. Aquinas in his Commentary on Galatians identifies "the works of the law" with the ceremonial provisions in the Torah. (Well, until he gets to Galatians 3, as we shall see later.)
It should be known, therefore, that some works of the Law were moral and some ceremonial. The moral, although they were contained in the Law, could not, strictly speaking, be called “works of the Law,” for man is induced to them by natural instinct and by the natural law. But the ceremonial works are properly called the “works of the Law.”
Thus it would seem he agrees with NPP proponents, who identify the "works of the law" with Mosaic ceremonial laws, because those are the laws that distinguished Jews from Gentiles. Yet Aquinas did not think the Judaizers were wrong because their sociology was too nationalistic. Instead, it was because the Old Testament ceremonies could not confer grace:
But with respect to being made just by the works of the Law, a man does not seem to be justified by them, because the sacraments of the Old Law did not confer grace. How turn you again to the weak and needy elements? i.e., that neither confer grace nor contain grace in themselves. The sacraments of the New Law however, although they are material elements, are not needy elements; hence they can justify. Again, if there were any in the Old Law who were just, they were not made just by the works of the Law but only by the faith of Christ “Whom God hath proposed to be a propitiation through faith,” as is said in Romans (3:25).
The following passages of Aquinas's commentary are difficult, because he offers multiple possible interpretations. In particular, in his interpretation of Galatians 3:10-12, he offers two interpretations. The latter is exactly the traditional Protestant understanding of "the works of the law":
Furthermore, some works of the Law are ceremonies carried out in the observances; others are works that pertain to morals, with which the moral precepts deal. Hence, according to a Gloss, that which is said here, namely, as many as are of the works of the law, are under a curse, is to be understood of ceremonial works and not of moral works. Or it should be said that the Apostle is speaking here of all works, both ceremonial and moral. For the works are not the cause making one to be just before God; rather they are the carrying out and manifestation of justice. For no one is made just before God by works but by the habit of faith, not acquired but infused. (italics mine) And therefore, as many as seek to be justified by works are under a curse, because sin is not removed nor anyone justified in the sight of God by them, but by the habit of faith vivified by charity: “And all these being approved by the testimony of faith, received not the promise” (Heb 11:39).
To be sure, Aquinas clearly does not hold to the Protestant view of justification as imputed righteousness, but rather the Catholic view as infused righteousness. Yet I would argue that both Aquinas and traditional Protestants interpret "the works of the law" in a way that upholds the grace-fullness of justification, either through sacramental infusion of justice (Catholicism) or through covenantal imputation of justice (traditional Protestantism). In contrast, the New Perspective on Paul sees justification as being attained through "good works", ie socially uniting oneself to God's people, which was Israel in the OT and is the Church in the NT.