In all actions brought to determine the right to any office it shall be necessary for the plaintiff or relator whenever the defendant is in possession of the office in controversy under a certificate of election issued by the proper officer or board of canvassers, to state in his complaint in what respect such certificate was improperly or illegally issued; and in case it is claimed that the relator received a majority of legal votes cast for the office at any legal election to fill such office he shall also state in such complaint the number of legal votes cast, as far as he may be able so to do, for the relator and for the defendant for such office respectively, and also the number of votes cast for the relator and for the defendant respectively for such office, as determined by the legal canvass of such election.
NMS § 44-3-7