All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
If this child was born out of wedlock (i.e. from Zina – fornication or adultery), then he is not traced back to the fornicator/adulterer; rather, he should be traced back to his mother. All rulings of inheritance and filiation with her would apply to him, because he is really her son.
Furthermore, she is obligated to protect her son and not give him to that non-Muslim man; as she is the one who is responsible for him. For more benefit, please refer to Fatwa 85430. As regards that man, he has no relation with the child and he does not have to support him and he has no form of guardianship over him.
Also, you have no form of guardianship over him [the child] whether or not you would marry his mother. You are, in regard to him, like any other Muslim individual with his Muslim brother, you should advise him, guide him, and prevent him from what harms him in his religion and in his worldly matters. Moreover, you are obligated to protect him if there is no one else to do so, and in this case you should teach him what he must learn of his religious matters provided that you are not harmed by doing so. Surely, you will be rewarded for doing so and you will not be sinful, Allaah willing. The Prophet said: “Allaah helps His Slave as long as His Slave helps his Muslim brother.” [Muslim]
It should be noted that it is an obligation in marriage to fulfill the conditions for the validity of the marriage contract among which are the consent of the guardian and the presence of two witnesses.
If a woman has no Muslim guardian, the one who marries her off is the Muslim judge or whoever acts on his behalf like the Muslim community such as Islamic Centres. In case there are none of these, she may authorize a Muslim man (to marry her off). Ibn Qudaamah said: “If a Muslim woman has no guardian and there is no Muslim ruler, then according to Imaam Ahmad, there is evidence which proves that a just and trustworthy Muslim man may marry her off with her permission.” For more benefit, please refer to Fatwa 88488.
Allaah Knows best.