This is a great question. I would say that many biblical books and passages led to Martin Luther's ground breaking doctrine of justification by faith alone. However, if we read his works on Galatians, Romans and the Psalms, there were a few pivotal verses that created a shift in Martin Luther's thoughts.
First, he hated the phrase, "righteousness of God." He took these words to mean that God would judge people righteously because of their sins. This was bad news, because Luther knew that all peopled sinned. As Paul says: "For all have sinned and fall short of the glory of God." Romans 3:23. This led to a crisis of faith. How can a man be justified in the sight of God.
Second, as Martin Luther was studying more, he realized that God's solution was found in the work of Christ, which people appropriate by faith. For example, Habakkuk in the Old Testament was pivotal for him. Habakkuk 2:4 states: "The just shall live by faith." Paul also quotes this in the Romans 1:18. Other passages that helped Luther were from Galatians 4, Romans 1-4, and Philippians 3. On account of all these verses, Luther stated that a person was saved by faith in the person and work of Christ apart from their own merits. By saying this, he broke with the Catholic church.