One of the stickiest debates in all of New Testament scholarship is the debate over the Mosaic law. When Paul opposes works of law or Jesus opposes the Pharisees, what ae they opposing? We won't attempt a comprehensive answer to this question, but we do need to address it to some degree if we want to have a proper understanding of both justification and judgment. On questions of the law I would favor an approach probably within the New Perspective on Paul family, although my stance is a more mediating approach between perspectives old and new.
I do not believe that the term 'legalistic' is the best term to describe the approach of most first century Jews to the law (though that term may apply to the Essenes). One point at which I think this becomes clear is reading the Sermon on the Mount. If anything, at points it seems as if Jesus is opposing laxness and/or hypocrisy. With, that said, of course, any Jew in the first century would claim that one needed to keep the law to participate in God's eschatalogical salvation, which in a sense could be construed as legalistic, i.e., your performance has an effect on your salvation, but they did not generally believe that the law had to be kept perfectly, and they strongly believed that God was gracious and merciful towards them because of the covenant with Abraham. Some Jewish writings (like 4 Ezra) do seem to promote a 'merit theology' but that always needs to be understood within a wider covenantal framework.
When we get to Paul, again I do not find 'legalism' to be a helpful term describing the approach to the law that he opposed. A key passage for our understanding of these matters in Paul is Galatians 2:15-21. I've previously laid out my interpretation of that passage as a whole. The main issue in Galatians is whether or not Gentiles have to become Jews to become part of the people of God. Paul was combating, as Michael Bird puts it, 'ethnocentric nomism.' "Defined, ethnocentric nomism is the view that Jewish identity is the locus of salvation (hence ethnocentric) and that one must perform he law so as to enter the Jewish constituency and be vindicated at the eschaton (hence nomistic)" (The Saving Righteousness of God p. 117). Thus there was some link between law and the final judgment in the thinking of first century Jews, but I hesitate to call it legalism. With that said, I do firmly believe that the New Testament gives us the necessary ammunition to combat legalism today, but that takes us into the realm of systematic theology. One emphasis in Galatians, though, isn't on the fact the the Galatians are being pressured to follow a standard, it's on the fact that the standard erects a barrier between Jew and Gentile hindering God's family from becoming a world wide family. The other reason why nomism is so problematic to Paul is that it undercuts the sufficiency of the work of Christ and the Spirit.
One thing that this brief overview draws out, yet again, are the covenantal aspects of judgment and justification. In Galatians, Paul is answering the question, 'who are the people of God?' He answers that question by talking about justification by faith. This helps us to see that we shouldn't think of justification and judgment solely on the individual level. There are corporate, ecclesial aspects.
With this portion of the discussion under our belts we are now ready to jump headlong into our investigations into justification. Here we will take some time to examine several different and important views. In separate posts I'll treat Doug Moo, Michael Bird and Kevin Vanhoozer (I'll take these two together because of certain similarities), NT Wright, and Michael Gorman.