Failure of an insurer transacting insurance in this state to have a certificate of authority shall not impair the validity of any act or contract of the insurer and shall not prevent the insurer from defending any action in any court in this state; but no such insurer shall be permitted to maintain an action in any court of this state to enforce any right, claim or demand arising out of any such transaction, other than as to a surplus line coverage duly written through a licensed surplus line broker of this state, until the insurer has obtained a certificate of authority.
NMS § 59A-15-5