Hi there ,
Thanks for writing to us,
Yes, tests like DNA paternity test helps to find the father of baby in womb before birth.
As your friend wear condom during his intercourse ,it decreases the chance of making that girl pregnant ,while the chances of the other guy is more, since he ejaculates in the girl.
Having condom on intercourse minimize the chance of transfer of HPV
Hope helped your query.