I faced the same issue while connecting to mongo through mongo-express. Below are the steps i followed to get rid of the issue.
It should look like "docker run -it -p 8081:8081 -e ME_CONFIG_MONGODB_URL=mongodb://root:root@{IP address of mongodb container} mongo-express " this will work if your mongo server is not running on a separate network.
IP Address can be found using "docker inspect {mongo server container id}"
Your command would be "docker run -it -p 8081:8081 -e ME_CONFIG_MONGODB_URL=mongodb://root:root@{Mongo server name (or) IP address of mongodb container} --network {network id} mongo-express ".
Network id can be found using "docker network ls". search for your mongo server.
Please Upvote if you find this helpfull.