“Whoever enters a horse (in a race) between two other horses,
not
knowing whether it will win, that is not gambling. But whoever
enters
a horse (in race) between two other horses, certain that it
will win,
that is gambling.”
Sunan Ibn Majah Book 24, Hadith 124