Do you have a backup of a previous version of the file? Error code 5 is probably fatal.
What version of ID and OS?
If you don't have a backup (and this should teach you that you ALWAYS need to back up your files), your best hope is either Repair corrupt InDesign Adobe files on Mac OS X or Markzware's paid recovery service: Bad InDesign or Quark File Recovery Submission Form
1 person found this helpful
Probably too late to help, but I had a large document become corrupted using InDesign CC today. Every time I tried to open the document it would give a problem message, most often Error Code 5. InDesign crashed repeatedly when trying to open it. The recovery files refused to open too. Instead of all this about paying for services and wasting time, I just changed the file extension to .idml and the document opened. I exported another .idml from the first .idml (really the .indd just renamed) and then opened the second .idml. Saved it as a new .indd and the file has been fine ever since.
Didn't want to lose all that work and don't have time to wait for a paid service.
Another good save is the PDF to InDesign plugin if you have exported a PDF recently. Doesn't give you all your styles and such but those are easy enough to define with a couple clicks of the already-formatted text. Good luck to anyone reading this in the future.