Reverse your logic and it's pretty easy.
echo "_waiting 5 minutes"
sleep 300
echo "_starting Container X"
/usr/bin/docker start (container X)
echo "_starting Container Y"
/usr/bin/docker start (container Y)
echo "_starting Container Z"
/usr/bin/docker start (container Z)
echo "_modifying hosts"
?command to add hosts entry?
Disable auto start for the containers, set the script to start at array start, it waits 5 minutes, starts the container(s), then does your hosts thing.
Sorry, no help there. Why does it have to be limited to those containers, and why only after start? Couldn't you just do the magic in your router, or in Unraid itself?