I would use the docker client’s command: docker exec
In order to docker exec from one container into another you need to install the docker client inside the client container and the client container needs to mount the docker socket:
docker run -v /var/run/docker.sock:/var/run/docker.sock
Code examples for dockerfiles docker clients can be found here: https://hub.docker.com/_/docker/
Then start the target container with a static service name:
docker run --name
Afterwards you can execute from your source container’s command line the target container’s script:
docker exec targetcontainer /bin/bash -c "command arguments"
If you do not want to expose your docker.sock then you can also expose your script through http: https://github.com/msoap/shell2http