Unless it is otherwise provided or the context plainly requires otherwise, if a statute outside this title defining an offense, or a related statute, or a rule or regulation thereunder, contains a provision constituting an exception from criminal liability for conduct which would otherwise be included within the prohibition of the offense, that the defendant came within such exception is a defense.
N.D.C.C. § 12.1-01-03