Another matter: Rabbi Tanḥuma said: There was an incident involving a certain ship on which all [the passengers] were idolaters, and there was one Jew among them. They reached a certain island. They said to that Jew: ‘Take money, go up onto this island and purchase something for us from there.’ He said to them: ‘Am I not a stranger? Do I know where I am going?’ They said: ‘Is there a Jew who is a stranger? Everywhere you go, your God is with you.’32According to the Jerusalem Talmud (Berakhot 9:1), this incident occurred after the ship had been in dangerous seas, and all the idolators called out to their idols to save them and it was all to no avail, and then the Jew prayed to God and they were saved (Maharzu). That is, “that has God near it.”
The Lone Jew on a Ship Full of Idolaters
Devarim Rabbah 2:16