They met when Luna had to go to the Desert lands for a trade deal. She had to sneak into the country due to some weird rule about mares being subservient or something and had to disguise herself as a unicorn. She hired (nameless) as her bodyguard/guide at a bar after he rescued her from some thugs. They bonded on the way there, him showing her the correct way to navigate through the desert and her teaching him fighting techniques lost to time. Neither knew the others true identity until they arrived at the Sphinx's palace.
Note: Sphinx's worships the Sun, due to how closely tied they are to the Sun for biological reasons. As such, they revered Princess Celestia as a Goddess. Princess Luna was basically forgotten since her sister was raising the Sun and Moon for centuries.