I have the exact same problem: Indesign CS4 on Maverics just shows "Error Code 5" in a message and does not start.
CS4 is old and was never designed for Mavericks. You can try uninstalling or running the Adobe Cleaner tool:
Then reinstall again from your original media. If you cannot find it, then you can download here (but there are no guarantees that it will work):