Container accessing a local service on Mac

Let us say I have a service on my Mac that is listening on port 9999.

Can a container run from my Mac access the local service running on the Mac?

How to go about?

Thanks
Naga