The word translated neighbor in Exodus 3:22 is the female form of שָׁכֵן. Its verb form means to dwell (see In John 1:14 what does ἐσκήνωσεν mean?). Thus, it has the idea of one living nearby. While neighbor is רֵעַ in the "love your neighbor" passage (Leviticus 19:18). This word more often means friend and is the most common word for friend in the Tanakh (Hebrew Old Testament). See Given the dynamics of the words πλησίον and רֵעַ, what did Jesus illustrate with the Good Samaritan?)
Figure 1. Hebrew words translated neighbor in the ESV.
The terms sojourner גֵּ֣ר and foreigner/stranger נָכְרִי are used for the Israelites in Egypt, of course not the Egyptians (Exodus 2:22).
The word translated ask שׁאל usually meant ask. It rarely meant borrow. The context doesn't seem to support borrow. However, the JSP1985 translation does translate it borrow.
- shall borrow Rather, “shall request,” which is the usual meaning of the stem sh-ʾ-l.-- Sarna, N. M. (1991). Exodus (p. 19). Jewish Publication Society.
Figure 2. The senses of שׁאל in the Tanakh.
Related question: Exodus 12:36 Did the Egyptians obey because they favored the Israelites, or because God favored the Israelites?