The name of the phenomenon is alloparenting.
It is common in many species and there are some indications that it is specifically tied to sexual attraction. In particular, years ago there was a post or two made about this behavior among Mongolian gerbils. Certain male gerbils who spent their gestation period between two female siblings have a tendency to look after young gerbils and frequently have an erection while doing so. That indicates an epigenetic model for pedophilia tied to exposure to hormones in utero - at least among gerbils.