From 40 Questions About Christians and Biblical Law, by Thomas R. Schreiner, in the answer to the question, “Does the Pauline teaching on justification contradict Jesus’ message?”
The parable of the Pharisee and the tax collector clearly functions as an antecedent for Paul’s theology of justification (Luke 18:9-14). The Pharisee was convinced that God was pleased with him because of his devotion to the law, which went beyond what was expected. He expected to be justified because of his moral excellence, which elevated the Pharisee far above the tax collector. The tax collector, however, was deeply conscious of his sins and pled with God to have mercy on him as a sinner. And it was the tax collector who “went down to his house justified” (Luke 18:14) rather than the Pharisee. Those who trusted in themselves that they were righteous (Luke 18:9) are condemned. Those who exalt themselves are humbled (Luke 18:14). The only pathway to justification is to follow the example of the tax collector in saying, “God, be merciful to me, as sinner” (Luke 18:13). It is hard to imagine a closer parallel to the Pauline teaching on justification.
And there is much more evidence in the gospels to show that Jesus
emphasized that life comes from putting one’s faith in him, that human beings are spiritually impoverished, and that life comes from believing in Jesus rather than working for God. Hence, it is not too bold to conclude that Paul derived his message of justification from the historical Jesus.