عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ قَالَ مَنْ أَدْخَلَ فَرَسًا بَيْنَ فَرَسَيْنِ وَهُوَ لَا يَأْمَنُ أَنْ يَسْبِقَ فَلَا بَأْسَ بِهِ وَمَنْ أَدْخَلَ فَرَسًا بَيْنَ فَرَسَيْنِ قَدْ أَمِنَ أَنْ يَسْبِقَ فَهُوَ قِمَارٌ
It is narrated from Sayyiduna Abu Hurairah, may Allah be pleased with him, that the Noble Prophet, peace and blessings be upon him, said: If a person enters a horse between two competing horses, while he is not certain of winning, then there is no harm in doing so. But if someone puts his horse between two horses while he is certain of winning, then this will be considered gambling.