Get service name from ipaddress

I would like to know if there’s a way to find out within a running container the name of another service by its IP address (giving that they’re connected on the same overlay network).