I don’t think you can send a keystroke to an inactive application.
But you can hide an app immediately after activating it and executing code for it. This does however, cause the app to briefly flash before it hides, unless the app is running in fullscreen.
tell application "System Events"
tell application "X" to activate
key code 49
set visible of process "X" to false
end tell