The next day John saw Jesus coming towards him and said, ‘Look, the Lamb of God, who takes away the sin of the world! This is the one I meant when I said, “A man who comes after me has surpassed me because he was before me.” I myself did not know him, but the reason I came baptising with water was that he might be revealed to Israel.’
Then John gave this testimony: ‘I saw the Spirit come down from heaven as a dove and remain on him. And I myself did not know him, but the one who sent me to baptise with water told me, “The man on whom you see the Spirit come down and remain is the one who will baptise with the Holy Spirit.” I have seen and I testify that this is God’s Chosen One.’
To me the implication is that John did not know that his own cousin / relation was the Messiah until His baptism!
Is this the correct understanding of "I myself did not know him"?