It shall be lawful for any person letting or renting any house, room, shop, or other building whatsoever, or any boat, booth, garden, or other place, which shall, at any time, be used by the lessee or occupant thereof, or any other person, with his or her knowledge or consent, for gambling purposes, upon discovery thereof, to avoid and terminate such lease, or contract of occupancy, and to recover immediate possession of the premises by an action at law for that purpose.