Hi yes you can get a German Residence Permits (aufenthaltstitel)if you have a baby with someone who have permanent residence permit. But that's after your child has been granted the Residence Permits. There are some requirements that u have to meet up wih. Like having the Custody of the Child and also having the A1 certificate. Try and engage a German Immigration lawyer
Good luck and best regards
Nelly