You are asking very important questions. Your focus on what is best for the child, not on the interests of all the adults involved, is appropriate and admirable. Your wife deserves lots of credit for understanding that having a relationship with this love child in no way threatens her or the children you have had together. There is always enough love to go around if people are loving.
In general, secrets in families are toxic. They have a way of eventually surfacing and causing a great deal of pain. My vote is to follow your instincts and to tell the little girl the truth, reinforcing that you in no way want to diminish her relationship with the father she’s known.
Be clear with the child’s mother that you are interested in doing this to help the child. The child deserves to know about the medical facts. She also deserves to know the truth about her own identity. Be clear that you are not interested in helping the mom manage any bad feelings she has about her ex.
I do think the other man should also be told. It’s inevitable that he will find out. It’s better to be in control of revealing the information than to have it come out either in anger by his ex or as a slip from the girl. It would be helpful if the two of you could have a face to face conversation about the situation. You don’t have to be new best friends. But you do need to agree that neither of you will ever speak critically about the other to the child. It’s also wise to agree that there is nothing to be gained by getting into conversations about the child’s mother. The focus should only be on how you can both help this little girl grow up healthy and strong.
With care, your introduction into her life expands the universe of love and support for this little girl. There is no reason for her to have to “choose” a dad. She can have and enjoy the love of two men in her life.
I wish you well.