Normally it is not possible unless, as posted above, the running app provides an alternative known way (via intents, for instance).
If it must work with any third-party app, you could try with an accessibility service, you can send some basic actions (not all) to the focused views of the current activity.
With a rooted device, you can programatically simulate any touch event or pressing any key.
Without any of these, you can still connect with usb and perform "adb shell input ..." to simulate any input.