A court has allowed a four-year-old girl to be adopted by a same-sex couple despite her birth parents' opposition on the basis of their Catholic faith.

The girl was taken from her birth mother at four days old due to the mother's long history of drug use and conviction for the manslaughter of her infant son seven years earlier.

The birth mother opposed the child's adoption on the basis of her Catholic faith.

The seven-month boy died from methadone and benzodiazepine poisoning and while his mother was found guilty over giving the boy the drugs causing his death, she continues to blame her then-partner for administrating the fatal drugs.

A same-sex couple who have cared for the girl – known for legal reasons as CJD – since she was six months old wished to legally adopt her.