Psalm 130: "1 Out of the depths I cry to you, O LORD! 2 O Lord, hear my voice! Let your ears be attentive to the voice of my pleas for mercy!
"3 If you, O LORD, should mark iniquities, O Lord, who could stand? 4 But with you there is forgiveness, that you may be feared.
"5 I wait for the LORD, my soul waits, and in his word I hope; 6 my soul waits for the Lord more than watchmen for the morning, more than watchmen for the morning.
"7 O Israel, hope in the LORD! For with the LORD there is steadfast love, and with him is plentiful redemption. 8 And he will redeem Israel from all his iniquities."
Ephesians 2:8-9: "8 For by grace you have been saved through faith. And this is not your own doing; it is the gift of God, 9 not a result of works, so that no one may boast."
Romans 5:20-21: "20 Now the law came in to increase the trespass, but where sin increased, grace abounded all the more, 21 so that, as sin reigned in death, grace also might reign through righteousness leading to eternal life through Jesus Christ our Lord."
1 Timothy 1:14: "and the grace of our Lord overflowed for me with the faith and love that are in Christ Jesus."
+++
The text is public domain:
From depths of woe I cry to Thee,In trial and tribulation;Bend down Thy gracious ear to me,Lord, hear my supplication.If Thou rememb'rest ev'ry sin,Who then could heaven ever winOr stand before Thy presence?
Thy love and grace alone availTo blot out my transgression;The best and holiest deeds must failTo break sin's dread oppression.Before Thee none can boasting stand,But all must fear Thy strict demandAnd live alone by mercy.
Therefore my hope is in the LordAnd not in mine own merit;It rests upon His faithful WordTo them of contrite spiritThat He is merciful and just;This is my comfort and my trust.His help I wait with patience.
And though it tarry through the nightAnd till the morning waken,My heart shall never doubt His mightNor count itself forsaken.O Israel, trust in God your Lord.Born of the Spirit and the Word,Now wait for His appearing.
Through great our sins, yet greater stillIs God's abundant favor;His hand of mercy never willAbandon us, nor waver.Our shepherd good and true is He,Who will at last His Israel freeFrom all their sin and sorrow.
+++
Psalm 130 is the primary source for the hymn. Roughly, the hymn's first verse is from verses 1-3; the second from verses 3-4; the third from verse 5; the fourth from verses 6-7; the fifth from verses 7-8.
Ephesians 2:8-9 appears in the second verse.
Romans 5:20-21 and 1 Timothy 1:14 both seem to appear in the lines "Through great our sins, yet greater still / Is God's abundant favor" in the last verse.
The lines "It rests upon His faithful Word / To them of contrite spirit / That He is merciful and just" in the third verse seem to come from 1 John 1:9: "If we confess our sins, he is faithful and just to forgive us our sins and to cleanse us from all unrighteousness."
A number of passages could be cited for the line "Our shepherd good and true is He" in the last verse, but John 10:11 bears the closest resemblance: "'I am the good shepherd. The good shepherd lays down his life for the sheep.'"