There are many places in Rashi's commentary where he uses a foreign language to translate a word used in the Torah.
For example, Bereshit 6:14:
בכפר: זפת בלשון ארמי. ומצינו בתלמוד כופרא
With tar. This is the Aramaic word for tar. We find in the Talmud {Hebrew Ref} [for tar]
And Devarim 21:14:
לא תתעמר בה: לא תשתמש בה בלשון פרסי קורין לעבדות ושימוש, עימראה. מיסודו של רבי משה הדרשן למדתי כן:
You may not exploit her. You may not utilize her. In the Persian language, servitude and utilization is verbalized as imra'ah. From the commentary of R' Moshe Hadarshan I have learned this.
However, Rashi is translating a word in Lashon Hakodesh (Biblical Hebrew) using a word in another language. How does he know that the word is the same, and it is not a false cognate?
Rashi does say (Bereshit 11:1) that the original language was Lashon Hakodesh (Before G-d mixed up all the languages - Bereshit 11:6-9), but that obviously doesn't mean that every word that sounds the same as a word in Lashon HaKodesh means the same thing.
So the question remains, How does Rashi know that the words in a different language mean the same thing as the same words in Lashon HaKodesh?