This is difficult for you, but you need to consider the likelyhood of the childs well being in a loving, intact, two parent home. As opposed to you fighting them in a protracted legal battle and thereby causing damage/confusion to your child. Just from the information youve given here youve only been in the childs life for 5 months, which means the mother could pick up and start over with someone else which would greatly benefit the child to have a two parent household with a mother and father. Since it was only 5 months the child wont ever remember who you were anyhow.
One more thing that I know is tough to think about is that any man that is willing to adopt someone else's child in order to make a family work has top notch character and has the childs and mothers best interests in mind.
Some things shouldnt be messed with and this is probably one of them bro. My vote would be to terminate your parental rights.
The damage and confusion to the child would far outweigh the emotional benefit you would receive from any sort of parental custody and contact.