screen -S session-id -p window-id -X stuff "command^M"
The script snippet below demonstrates this by launching a new screen session in detached mode, creating a second window in that session and then executing a different command in each window:
screen -X title shell0
screen -X screen -t shell1
screen -p 0 -X stuff "echo hello window 0^M"
screen -p 1 -X stuff "echo hello window 1^M"
Note that ^M stands for the newline charcter, which you can generate, in emacs or in a terminal running bash, by hitting <CTRL>-q and then <CTRL>-m or <ENTER>.