Chapter: Two men who race each other on their horses, each of them putting up some property (as a prize), and they bring in between them a muhallil (a third party) on the condition that if the muhallil outruns them both, whatever the two of them put up will be his, and if one of the two outruns the muhallil, he will keep his own property and take his companion's property (as well).
Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "Whoever enters a horse between two horses while he is fully free of any fear of its losing, that is gambling; and whoever enters a horse between two horses while he is not free of fear of its losing, that is not gambling."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السبق والرمي / 19770