The Prophet Moses (pbuh) was not the only prophet to have lived in ancient Egypt. The Prophet Joseph (pbuh) had also lived in Egypt long before the time of the Prophet Moses (pbuh).
In the stories of the Prophet Moses (pbuh) and the Prophet Joseph (pbuh) in the Qur'an, there is another important piece of information. To refer to the Egyptian ruler at the time of the Prophet Joseph (pbuh), the word "malik" (the King) is used in the Qur'an:
The King (Malik) said, "Bring him (Joseph) to me straight away! So I may draw him very close to me." When he had spoken with him, he declared, "Today you are trusted, established in our sight." (Surah Yusuf: 54)
In the time of the Prophet Moses (pbuh), however, the Egyptian ruler is referred to as the "Pharaoh":
We gave Moses nine Clear Signs. Ask the tribe of Israel about when he came to them and Pharaoh said to him, "Moses, I think you are bewitched." (Surat al-Isra': 101)
Historical records now available provide the reasons for the different names used to refer to these two rulers of Egypt. In ancient Egypt, the term "pharaoh" originally referred to the royal palace. During the reign of the ancient kingdoms, the rulers did not hold such a title. The word "pharaoh" came to be used as a synonym for the Egyptian king under the New Kingdom (starting in the 18th dynasty, 1539-1292 B.C.), and by the 22nd dynasty (c. 945-c. 730 B.C.) it had been adopted as an epithet of respect.1
Here again, the miraculous qualities of the Qur'an are evidenced once again: because the Prophet Joseph (pbuh) lived much before the New Kingdom, the Qur'an refers to the Egyptian king who was contemporary of the Prophet Joseph with the word "malik" and not "pharaoh." The Prophet Moses (pbuh), on the other hand, lived during the time of the New Kingdom, and, therefore, the Egyptian ruler who was contemporary of the Prophet Moses (pbuh) was referred to in the Qur'an as "pharaoh."
Clearly, such a distinction implies a certain knowledge of the history of the ancient Egypt. However, as mentioned earlier, the history of Ancient Egypt was completely forgotten by the 4th century, since hieroglyphic writing was not deciphered until the 19th century. Therefore, during the period the Qur'an was revealed, no in-depth knowledge of Egyptian history was available. This fact is yet another piece of evidence, among countless of others, proving the fact that Qur'an is the word of Allah.