Ephesians 1:3-7: "3 Blessed be the God and Father of our Lord Jesus Christ, who has blessed us in Christ with every spiritual blessing in the heavenly places, 4 even as he chose us in him before the foundation of the world, that we should be holy and blameless before him. In love 5 he predestined us for adoption as sons through Jesus Christ, according to the purpose of his will, 6 to the praise of his glorious grace, with which he has blessed us in the Beloved. 7 In him we have redemption through his blood, the forgiveness of our trespasses, according to the riches of his grace"
1 John 5:6-8: "6 This is he who came by water and blood - Jesus Christ; not by the water only but by the water and the blood. And the Spirit is the one who testifies, because the Spirit is the truth. 7 For there are three that testify: 8 the Spirit and the water and the blood; and these three agree."
+++
Ephesians 1:3-7 seems to be the basis for the hymn. Each verse of the hymn (save perhaps for the doxology at the end) expands upon "every spiritual blessing" from verse 3. Specifically, verses 4-5 appear in the hymn's first verse ("To be... His chosen, saved and free! / Saints blest with these rich gifts / Are children who proclaim / That they were won by Christ"), and verse 7 appears in the hymn's fifth verse ("The body and the blood / Remove our ev'ry sin") and third verse ("Forgiveness that we need / Is granted to us there").
1 John 5:6-8 appears mostly in the second verse, which is all about Baptism. Blood isn't mentioned in the hymn until the fifth verse, though.