The Prophet (ﷺ) said: If anyone leaves an animal at a place of perishing and another man brings it to life, it belongs to him who brings it to life.
Sunan Abi Dawud Book 24, Hadith 110