Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates from the Prophet (peace and blessings be upon him) that he said: "Horses are of three kinds: one for the Most Merciful, one for Satan and one for man. The horse that is for the Most Merciful is the one a person ties up in the path of Allah; its urine and dung will be placed in his scale. The horse that belongs to Satan is the one on which wagers are made. The horse of man is the one by which he seeks his livelihood out of fear of poverty." If this is established, then, and Allah knows best, what is meant is that two people put up stakes and do not bring in a third between them, in which case it is not permissible.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السبق والرمي / 19777