Dear @Adrian,
Thank you for your question - my colleague Éanna was answering a very similar one last year here.
He explained that you may be able to receive a residence permit according to section 25 (5) of the German Residence Act (as far as I know, the the decision on your application is at the discretion of the immigration office and you are not legally entitled to it) - a humanitarian permit which can be given for various reasons, such as a having a child here.
It will be important that you officially declare the paternity, share the custody and actually see the child. The authorities need to know that there is an actual relationship between you and the child.
I hope this helps and please don't hesitate to get back to us with any further questions.
All the best,
Meike