I had the same issues when I first started out with podman. The solution I found was to make a pod and place the containers within the pod. They'll be able to access each other through localhost:port. If you need ports published outside the pod, then they'll need to be specified during pod creation.
I didn't use podman-compose, so I can't speak specifically to how you'll go about this with a compose yaml.
It took many pages of websites for me to find something I understood. I'll see if I can find which websites I used and post them in a bit.
Here is the article I used to help me understand what I wanted to do. Hiding away in the actual Podman tutorials lol. Once I get my laptop up and running, i'll post my config since it's running in my learning environment and I haven't done anything with podman in my prod homelab; however, this let me get two containers (database and webapp) connecting together.
https://github.com/containers/podman/blob/main/docs/tutorials/basic_networking.md#Communicating-between-containers-and-pods
My environment is podman in AlmaLinux 9.4 SELinux inside a Hyper-V VM on Windows 11. I can access the webpapp in the podman pod from outside my laptop.