Every contract, conveyance, or assurance, of which the consideration, or any part thereof, is money, property, or other thing won or bet at any game, sport, pastime, or wager, or money lent or advanced at the time of any gaming, betting, or wagering, to be used in being so bet or wagered (when the person lending or advancing it knows that it is to be so used) shall be void as between the parties thereto, and as to all persons except such as hold or claim under them in good faith, for value, and without notice of the illegality of the consideration.
If any person shall lose to another within twenty-four hours $10 or more, or property of that value, and shall pay or deliver the same, or any part thereof, such loser may recover back from the winner the money or property, or in lieu of the property the value thereof, so lost, by suit in court, or before a justice, according to the amount or value, brought within three months after such payment or delivery. The loser may so recover from the winner, notwithstanding the payment or delivery was to the winner's indorsee, assignee, or transferee. But nothing in this section shall be so construed as to permit a recovery of such property, or its value, from any person (or those claiming under him) other than the winner, when such person has paid value for such property without notice of illegal consideration under which the winner derived his claim of title.
Such loser may file a bill in equity against such winner, who shall answer the same, and upon discovery and repayment or redelivery of the money or property so won, or its value, such winner shall be discharged from any forfeiture or punishment which he may have incurred for winning the same.