Sahih al-Bukhari, Book 60, Hadith 134 (Bukhari 3321)

Narrated Abu Huraira:

The Prophet (ﷺ) said, "While a dog was going round a well and was about to die of thirst, an Israeli prostitute saw it and took off her shoe and watered it. So Allah forgave her because of that good deed."