Knowing that a man is not justified by the works of the law, he's talking about the Mosaic Law. I've said to a number of people, to understand Romans, it's best if you start with Galatians. Galatians is a lot easier book to understand than Romans, and it was written before Romans. If you read Galatians, you see the whole context. I mean, Paul is really clear.
If you read Galatians and you think he's talking about Christian works, wow, you don't read carefully, I think, is about all I can say because he hammers that in and he gives a number of illustrations in Galatians about the Law of Moses. We're not saved by that, but the Jews were trying to force the Gentiles into that. Knowing that a man is not justified by the works of the law, he's talking about the Mosaic Law, but by faith in Christ Jesus. For by the works of the law, no flesh shall be justified.