كتاب السلام
39  
The Book of Greetings
(41)
Chapter: The Virtue Of Giving Food And Water To Animals Which Are Unlawful To Eat
(41)
باب فَضْلِ سَاقِي الْبَهَائِمِ الْمُحْتَرَمَةِ وَإِطْعَامِهَا ‏‏
Sahih Muslim 2245 b

Abu Huraira reported Allah's Messenger (ﷺ) as saying:

There was a dog moving around a well whom thirst would have killed. Suddenly a prostitute from the prostitutes of Bani Isra'il happened to see it and she drew water in her shoe and made it drink, and she was pardoned because of this.
وَحَدَّثَنِي أَبُو الطَّاهِرِ، أَخْبَرَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، أَخْبَرَنِي جَرِيرُ بْنُ حَازِمٍ، عَنْ أَيُّوبَ السَّخْتِيَانِيِّ، عَنْ مُحَمَّدِ بْنِ سِيرِينَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ بَيْنَمَا كَلْبٌ يُطِيفُ بِرَكِيَّةٍ قَدْ كَادَ يَقْتُلُهُ الْعَطَشُ إِذْ رَأَتْهُ بَغِيٌّ مِنْ بَغَايَا بَنِي إِسْرَائِيلَ فَنَزَعَتْ مُوقَهَا فَاسْتَقَتْ لَهُ بِهِ فَسَقَتْهُ إِيَّاهُ فَغُفِرَ لَهَا بِهِ ‏"‏ ‏.‏
Reference : Sahih Muslim 2245b
In-book reference : Book 39, Hadith 212
USC-MSA web (English) reference : Book 26, Hadith 5579
  (deprecated numbering scheme)