Welcome to one of the most controversial figure in ancient Japan history. Other than the fact that she existed and was both the ruler of a major part of Japan and the chief priestess, almost everything else about her is in dispute. Mostly because historians couldn't agree on the facts.
She lived in a time before a writing system in Japan, so there existed no records about her from the same era when she lived. She was only mentioned in ancient records from China (and some from Korea too if I'm not mistaken).
Keep in mind that there exists no direct quote from Kishimoto to confirm this ok. If anything Kishimoto mentioned the moon princess Kaguya from the bamboo cutter's tale as the folklore figure giving a name, a face, and an origin (alien from the moon, sort of) to Naruto's Kaguya.
Just that for me personally, other than the name and origin, Himiko seems a better fit for the character inspiration. A queen who possessed mysterious supernatural power, who had profound but hard to quantify influence on Japanese history, whose reign was the stuff of myths, whose powers were seen as alternating between divine and foul sorcery, and whose rule ended because she was betrayed by a male familial figure (there are tales that spoke of Himiko's defeat and death being assisted by her own younger brother). She was also either (or both) a tyrant or a wise rule who enforced communist-style equality on her people.
It's just my take but Naruto's Kaguya seems to come from combining moonprincess Kaguya from the Bamboo Cutter's tale with the mythical queen Himiko of ancient Yamatai. The moonprincess gives her the name, the face, and the origin. Himiko gives her rulership, powers, and history.