The nerve to the quadratus femoris muscle and the inferior gemellus muscle, and the posterior cutaneous nerve of the thigh (posterior femoral cutaneous nerve) also leave the pelvic cavity through the greater sciatic foramen inferior to the piriformis muscle and course to muscles and skin, respectively, in the lower limb.