Sounds like classical
proctalgia fugax ("fleeting pain in the bum" in Latin) to me. It's a pelvic floor or anal sphincter cramp. Quite common (yes, I've had it).
Reasonable description in Wikipedia -
Proctalgia fugax - Wikipedia, the free encyclopedia
The pain is deep, sickening, unpleasant visceral pain and this sort of pain classically produces vagal stimulation which slows your heart and drops your BP (hence fainting) which is what happened to you.
Try a warm drink and a walk. Gentle anal dilatation with a lubricated finger and internal massage seems to terminate it more quickly (though it rarely lasts more than 1/2 hour).
Welcome to the world of bottoms!
Mac