(דברים טו, ח) פתח תפתח אין לי אלא לעניי עירך לעניי עיר אחרת מנין ת"ל פתח תפתח מכל מקום
With regard to the mitzva of giving charity and granting loans, it is written: “For the poor shall never cease out of the land; therefore I command you, saying: You shall open [patoaḥ tiftaḥ] your hand to your poor and needy brother in your land” (Deuteronomy 15:11). I have derived only the obligation to give charity to the poor residents of your city. From where is the obligation to give charity to the poor residents of another city derived? The verse states: “Patoaḥ tiftaḥ,” to teach that you must give charity to the poor in any case.
אֵין מְמַחִין בְּיַד עֲנִיֵּי גוֹיִם בְּלֶקֶט בְּשִׁכְחָה וּבְפֵאָה מִפְּנֵי דַּרְכֵי שָׁלוֹם תָּנוּ רַבָּנַן מְפַרְנְסִים עֲנִיֵּי גוֹיִם עִם עֲנִיֵּי יִשְׂרָאֵל וּמְבַקְּרִין חוֹלֵי גוֹיִם עִם חוֹלֵי יִשְׂרָאֵל וְקוֹבְרִין מֵתֵי גוֹיִם עִם מֵתֵי יִשְׂרָאֵל מִפְּנֵי דַּרְכֵי שָׁלוֹם
§ The mishna teaches: One does not protest against poor gentiles who come to take gleanings, forgotten sheaves, and the produce in the corner of the field, which is given to the poor [pe’a], although they are meant exclusively for the Jewish poor, on account of the ways of peace. Similarly, the Sages taught in a baraita (Tosefta 5:4): One sustains poor gentiles along with poor Jews, and one visits sick gentiles along with sick Jews, and one buries dead gentiles along with dead Jews. All this is done on account of the ways of peace, to foster peaceful relations between Jews and gentiles.
את עמי ישראל וכותי עומדים לפניך ללוות עמי קודם. עני ועשיר עני קודם. ענייך ועניי עירך ענייך קודמין לעניי עירך. עניי עירך ועניי עיר אחרת עניי עירך קודמין שנאמר את העני עמך.
"My people": If an Israelite and a gentile stand before you to borrow, "My people" take precedence. A poor man and a rich man — the poor man takes precedence. Your poor (i.e., the poor of your family) and the poor of your city" — your poor take precedence. The poor of your city and the poor of a different city — the poor of your city take precedence. Thus, "the poor man with you" (i.e., closest to you).
את עמי. עַמִּי וְגוֹי עַמִּי קוֹדֵם, עָנִי וְעָשִׁיר עָנִי קוֹדֵם, עֲנִיֶּיךָ וַעֲנִיֵּי עִירְךָ עֲנִיֶּיךָ קוֹדְמִין, עֲנִיֵּי עִירְךָ וַעֲנִיֵּי עִיר אַחֶרֶת עֲנִיֵּי עִירְךָ קוֹדְמִין; וְזֶה מַשְׁמָעוֹ: אִם כֶּסֶף תַּלְוֶה – אֶת עַמִּי תַּלְוֵהוּ וְלֹא לְגוֹי, וּלְאֵיזֶה מֵעַמִּי? אֶת הֶעָנִי, וּלְאֵיזֶה עָנִי? לְאוֹתוֹ שֶׁעִמָּךְ. (דָּ"אַ, אֶת עַמִּי, שֶׁלֹּא תִנְהַג בּוֹ בִּזָּיוֹן בְּהַלְוָאָה שֶׁהוּא עַמִּי:
My people. [I.e. if you are faced with a choice of lending money to] one of My people or to a gentile, then “one of My people” has priority. [If the choice is between] a poor person and a rich one, then the poor person has priority. [If the choice is between] the poor of your city and the poor of another city, then the poor of your city have priority. (Mekhilta d'Rabbi Yishmael 22:24:3; Bava Metzia 71a).
איכא דמתני לה להא דרב הונא אהא דתני רב יוסף (שמות כב, כד) אם כסף תלוה את עמי את העני עמך עמי ונכרי עמי קודם עני ועשיר עני קודם ענייך ועניי עירך ענייך קודמין עניי עירך ועניי עיר אחרת עניי עירך קודמין
There are those who teach that which Rav Huna said in connection with that which Rav Yosef taught: The verse states: “If you lend money to any of My people, even to the poor person who is with you” (Exodus 22:24). The term “My people” teaches that if one of My people, i.e., a Jew, and a gentile both come to borrow money from you, My people take precedence. The term “the poor person” teaches that if a poor person and a rich person come to borrow money, the poor person takes precedence. And from the term: “Who is with you,” it is derived: If your poor person, meaning one of your relatives, and one of the poor of your city come to borrow money, your poor person takes precedence. If it is between one of the poor of your city and one of the poor of another city, the one of the poor of your city takes precedence.
עָנִי שֶׁהוּא קְרוֹבוֹ קֹדֶם לְכָל אָדָם. עֲנִיֵּי בֵּיתוֹ קוֹדְמִין לַעֲנִיֵּי עִירוֹ. עֲנִיֵּי עִירוֹ קוֹדְמִין לַעֲנִיֵּי עִיר אַחֶרֶת. שֶׁנֶּאֱמַר (דברים טו יא) "לְאָחִיךָ לַעֲנִיֶּךָ וּלְאֶבְיֹנְךָ בְּאַרְצֶךָ":
A poor person who is one's relative receives priority over all others. The poor of one's household receive priority over the poor of one's city. And the poor of one's city receive priority over the poor of another city, as [implied by Deuteronomy 15:11]: "[You shall surely open your hand to] your brother, the poor, and the destitute in your land."
מְפַרְנְסִין וּמְכַסִּין עֲנִיֵּי עַכּוּ''ם עִם עֲנִיֵּי יִשְׂרָאֵל מִפְּנֵי דַּרְכֵי שָׁלוֹם.
We provide sustenance and clothing for the poor of the gentiles together with the poor of the Jewish people as an expression of the ways of peace.