Check out this technote:
http://developer.apple.com/technotes/tn/tn2050.html The section on "Observing Arbitrary Processes" might be the one you want.
You're going to need some kind of helper to watch for the target process and launch your app at the right time.
A launchd deamon is the perfect thing for that.
This stuff requires writing C code. I don't of higher-level alternatives, though they could exist; this seems like the kind of thing someone might want to do in Applescript, for example.