Upon any prosecution for procuring, offering, or casting an illegal vote, the accused may give in evidence any facts tending to show that he honestly believed upon good reason that the vote complained of was a lawful one; and the jury may take such facts into consideration in determining whether the acts complained of were knowingly done or not.
SDCL 12-26-9