The Prophet ﷺ declared that practice invalid. Al-Khaṭṭābī and others have reported this (1).
In al-Muwaṭṭaʾ of al-Qaʿnabī (2) it is related that Mālik was asked about the Messenger of Allah’s ﷺ statement, “No jalb and no janab: what does it mean?” He replied, “This report has reached me, and its meaning is as follows:
Jalb is to drive a horse from behind until it nears the finish line, shaking something behind it to spur it on so that it wins.
Janab is to run another horse alongside the one being raced, and when they approach the line the rider shifts to the led horse.”
The underlying purpose is that the Prophet forbade giving either side an additional aid that would strengthen it over the other, for that entails injustice (3).
Therefore, if the stake is put up by only one of the two contestants, it gives the recipient an advantage over the one who paid. On this basis, some jurists allow the prize only when it comes from a third party.
But if both contestants furnish the stake, neither of them is thereby given an edge over the other, and such an arrangement is even more deserving of being permitted.