The nerve to the obturator internus supplies the gemellus superior muscle in the gluteal region and then loops around the ischial spine and enters the perineum through the lesser sciatic foramen to penetrate the perineal surface of the obturator internus muscle.
The nerve to the quadratus femoris supplies the gemellus inferior and quadratus femoris muscles.
Posterior cutaneous nerve of thigh