How can I secure NM cable in a tight spot?
You can get an NM cable stapler at a supply house or home center, that is if you can fit it into this area.

Also, we many times use our linemans pliers to pound staples. Sure, it's not the intended use, but in a tight spot many times they work perfectly. Hit with the face where the cutters are.