John was not saying that he did not recognize Jesus as the Messiah in the way that we do not perceive or recognize a person's identity, like an old acquaintance or relative, but instead that Jesus had received recognition not from him (John), but from heaven that he (Jesus) was the Christ. The Greek word εἴδω is used the same way that we use the word "recognize" in English, such as when you are "recognized" in a police line-up as the suspect that committed the crime (identity), or when you are "recognized" for exceptional academic achievement by the Dean of the College (distinction). John is saying that it is not he who has made the formal recognition of Jesus as Christ, but God. It is not that he is unaware that Jesus is unique (identity), but that the formal recognition of being the Messiah is not from John, but from God (distinction).
So it is interesting that John uses these two meanings of this Greek verb in this passage. We see the former in John 1:26, when John accuses the Pharisees of not recognizing the person within their midst who is the anointed (like not recognizing an old acquaintance); and again in this passage, when John denies that it is he who is making the formal recognition of Jesus as the Christ (instead that distinct recognition is coming direct from heaven). So these two facets of the meaning of εἴδω occur in this chapter.
The sign from heaven, which John was to watch for, was that the Spirit would descend from heaven like a dove, at which time the voice from heaven had declared, "This is my beloved son, in whom I am well pleased." It was this heavenly "recognition" that made Jesus to be the Christ, not John. John was the prophet by whom heaven made this recognition; thus it was not John who "recognized" Jesus as the Christ, but God in heaven. When John says that Jesus is the Son of God, he is making the connection that Jesus is the anointed "son" as described in the David Covenant (2 Sam 7:14) and in Psalm 2:7, where in both passages the "son" nexus appears in the Hebrew Bible in connection with the Anointed Christ. That is, the voice from heaven (God) is saying that Jesus is his son.
So here is the passage in question with my amplification [bracketed in bold] based on the previous paragraphs -
John 1:29-34 (NASB)
29 The next day he saw Jesus coming to him and said, “Behold, the Lamb of God who takes away the sin of the world! 30 This is He on behalf of whom I said, ‘After me comes a Man who has a higher rank than I, for He existed before me.’ 31 I did not [formally] recognize him [as the Christ], but so that He might be manifested to Israel, I came baptizing in water.” 32 John testified saying, “I have seen the Spirit descending as a dove out of heaven, and He remained upon Him. 33 I did not [therefore formally] recognize Him [as the Christ], but He who sent me to baptize in water said to me, ‘He upon whom you see the Spirit descending and remaining upon Him, this is the One who baptizes in the Holy Spirit.’ 34 I myself have seen [the descending Spirit as a dove], and have testified [based on the explicit voice heard from heaven] that this is [the Christ,] the Son of God.”
To reinforce this interpretation, Jesus was very explicit that John was not the source of his authority, although John had testified to his authority as the Christ.
John 5:32-37 (NASB)
32 There is another who testifies of Me, and I know that the testimony which He gives about Me is true. 33 You have sent to John, and he has testified to the truth. 34 But the testimony which I receive is not from man, but I say these things so that you may be saved. 35 He was the lamp that was burning and was shining and you were willing to rejoice for a while in his light. 36 But the testimony which I have is greater than the testimony of John; for the works which the Father has given Me to accomplish—the very works that I do—testify about Me, that the Father has sent Me. 37 And the Father who sent Me, He has testified of Me. You have neither heard His voice at any time nor seen His form.
The form was the dove, which they had not seen, and the voice from heaven was the declaration of his anointing, which they had not heard either, but it was still John who had testified this truth to them. So Jesus was saying that his authority did not come from man (John), but from heaven (God). Jesus also mentions his works (miracles), which were superior to the miracles of Moses - for example, Jesus healed the blind, which was never recorded in the Hebrew Bible, and of course Jesus walked on water whereas Moses had to split the waters. The multiplication of bread came not from heaven (manna), but from his own hand, etc. So Jesus declares himself the be "Christ" based on his works and the truth evident from heaven, which John had seen and heard, and who therefore had testified to the truth.
Finally, and not unrelated, Jesus once asked the Scribes whether the baptism of John was from men or from heaven (Mark 11:29-33). While the Scribes refused to answer Jesus, based on the preceding paragraphs, Jesus could have answered the following: (a) If they believed that the baptism of John was from man, then John denied that he ever "recognized" Jesus as the Messiah, but instead testified that he saw the Spirit in the form of a dove and heard the voice, which was what "recognized" Jesus as the Anointed One; or (b) If they believed that the baptism of John was from heaven, then the authority of Jesus to teach stemmed from John's baptism, when the Spirit in the form of a dove descended and the voice declared him the "Son," which was the formal "recognition" that Jesus was the Anointed One.
In summary, the "recognition" of Jesus as Messiah (Christos = Anointed One) did not come from man on earth (such as John the Baptist), but from God in heaven.