All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
You did not clarify to us whether this woman was pregnant from a previous marriage or if the child was conceived out of wedlock (from fornication). Accordingly, it is possible that the marriage is valid and that the boy is attributed to that man (your friend), and it is also possible that the marriage is invalid because the previous marriage is still intact. In this case, the boy might be attributed to her first husband and might be attributed to the second husband according to the details mentioned by the scholars of Fiqh in this regard.
Given the existence of these possibilities, the matter requires further examination and details. It is better to refer the case to the Islamic entities concerned with addressing the Muslims' affairs and settling their disputes in your country, such as the Islamic centers.
Allah knows best.