
439 P.2d 557 (1968)
79 N.M. 39
Virgilio TRUJILLO and Tonita M. Trujillo, his wife, Plaintiffs-Appellants,
v.
ACEQUIA de CHAMISAL, New Mexico, David Abeyta, Mayordomo, Acequia de Chamisal, New Mexico, Edelio Abeyta, Fernando Dominguez, Samuel Lopez, Commissioners, Acequia de Chamisal, New Mexico, Defendants-Appellees.
No. 73.
Court of Appeals of New Mexico.
March 22, 1968.
Frank Bachicha, Jr., Santa Fe, Eliu E. Romero, Taos, for appellants.
Matias L. Chacon, Chacon & Melendez, Espanola, for appellees.

OPINION
ARMIJO, Judge.
This appeal follows the entry of order sustaining motion to dismiss Taos County District Court cause number 7570 after applying the doctrine of res judicata.
Appellants are the parents of Arturo Trujillo. Arturo had earlier filed cause number 7392 in Taos County District Court, which action was against appellees, and sought damages for alleged trespass and injury to real property. This is the basis for this suit and the relief sought is substantially the same.
*558 During the trial of cause 7392 on its merits, it developed that plaintiff therein claimed title to the land in question by virtue of deed executed by his father. His mother had not joined in this deed. Since admittedly the real estate was community property, the trial court concluded the deed was void. On appellees' motion, the trial court dismissed the action with prejudice.
The disposition in cause 7392 was the basis for the application of the doctrine of res judicata in cause 7570.
Appellants' contention is that the trial court erroneously applied the doctrine of res judicata and in this we agree.
Appellees argue that the order recites the trial was on the merits and resulted in dismissal with prejudice, that there existed privity between the plaintiffs in the two cases and also contends the present plaintiffs are collaterally estopped.
The following is quoted from the record in cause 7392:
"THE COURT: The motion to amend will be overruled. Judgment will be in favor of the Defendants, and you may prepare an order or a judgment to that effect.
"MR. BACHICHA: May the order include the right for the plaintiff to refile this suit?
"MR. CHACON: Well, it would be with prejudice as against this Plaintiff at the present time.
"THE COURT: As against this Plaintiff, but I don't think it in any way binds Virgilio.
"MR. CHACON: No. No.
"MR. BACHICHA: No, but that the case may be refiled, or without prejudice.
"THE COURT: No, I can't say that it could be without prejudice to the rights of this particular Plaintiff. Any ruling here does not affect the right of Virgilio Trujillo, or whoever the real owner is. My ruling is that Virgilio and his wife are still the owners of the property and they are not the Plaintiffs in this suit, and therefore, the suit cannot be maintained by the son on the strength of this deed, which is void. That will be all. Court will be in recess."
Res judicata involved the following principle, as set forth in the case of Costilla Estates Dev. Co. v. Mascarenas, 33 N.M. 356, 267 P. 74 (1928):
"It is not questioned that Jahren v. Butler, 20 N.M. 119, 147 P. 280, laid down the correct rule, in quoting from 24 Cyc. 765, as follows:
"`A judgment of a court of competent jurisdiction, upon the merits of a controversy, is conclusive between the parties and those in privity with them, upon every question of fact directly in issue, determined in the action.'"
Or as otherwise stated, there must be an identity of subject matter, causes, parties and character of the person for or against whom the claim is made. Adams v. Cox, 55 N.M. 444, 234 P.2d 1043 (1951).
Paulos v. Janetakos, 46 N.M. 390, 129 P.2d 636, 142 A.L.R. 1237 (1942), sets forth the test for determining what is an issue of fact before the doctrine may be applied:
"It must be a fact, the determination of which is material, relevant, and necessary to a decision of the case upon its merits * * *. It must not be a fact that comes collaterally or incidentally in question * * *, or one that is not material or essential to a decision, even though put in issue by the pleadings. * * *, or evidentiary facts from which the ultimate fact is inferred. * * *."
See also, State v. Johnson, 52 N.M. 229, 195 P.2d 1017 (1948); Salazar v. Murphy, 66 N.M. 25, 340 P.2d 1075 (1959) and State v. Nance, 77 N.M. 39, 419 P.2d 242 (1966).
Case 7392 was set down for trial on its merits; however, during the course of trial it developed the plaintiff had no standing in court and the case was dismissed. Although the order of dismissal stated that it was on the merits, it becomes incumbent on us to inspect the record to ascertain if the recitals in the order are supported *559 thereby. Pueblo de Taos v. Archuleta, 64 F.2d 807 (10th Cir.1933); Larkin Packer Co. v. Hinderliter Tool Co., 60 F.2d 491 (10th Cir.1932) and Grattan v. Societa Per Azzioni Cotonificio Cantoni, 151 F. Supp. 813 (S.D.N.Y. 1957). In Pueblo de Taos v. Archuleta, supra, it was stated: "The court may and must inspect a judgment pleaded in bar, and if necessary explore the record, to ascertain what was determined by it"; also, we may ascertain the meaning and effect of the judgment. State ex rel. Booth v. Beck Jewelry Enterprises, 220 Ind. 276, 41 N.E.2d 622, 141 A.L.R. 876 (1942), or the ultimate facts resolved by the judgment. The Evergreens v. Nunan, 141 F.2d 927, 152 A.L.R. 1187 (2d Cir.1944).
Contrary to the recital in the order, dismissal of the former case was not on the merits.
The facts were put in issue but not actually adjudicated either expressly or impliedly. The effect is that dismissal was for want of capacity to sue, and the mistaken belief by plaintiff in the first case, that he owned the land, will not operate as a bar to the subsequent suit where no disposition was had on the merits.
The holding in Tucker v. New Orleans Laundries, Inc., 238 La. 207, 114 So.2d 866 (1959), announces the rule we here follow:
"* * * neither a judgment of non-suit nor one dismissing a suit for want of proper parties will serve as a basis for the plea of res judicata, for in such a suit the judgment of the court has decided nothing on the merits of the controversy."
See also Morrissey v. Bologna, 240 Miss. 284, 123 So.2d 537 (1960); White v. Pottawatomie County, 199 Okl. 103, 184 P.2d 446 (1947) and City of San Antonio v. State ex rel. Criner, 270 S.W.2d 460 (Tex. Civ.App. 1954).
The order in cause 7570 dismissed that action with prejudice. The only effect of that recital is to bar another suit by Arturo on the same cause of action. It does not bar the claim of the present plaintiffs since their claim is a separate cause of action. Compare Curtis Manufacturing Co. v. Barela, 76 N.M. 392, 415 P.2d 361 (1966).
Since the dismissal in the first case was not on the merits, the doctrine of res judicata was not applicable. Swift v. McPherson, 232 U.S. 51, 34 S.Ct. 239, 58 L.Ed. 499 (1914); Smith v. Pinner, 68 Ariz. 115, 201 P.2d 741 (1949); Hutchings v. Zumbrunn, 86 Okl. 226, 208 P. 224 (1922). Thus, we do not reach the conclusion of privity nor the issue of collateral estoppel.
We reverse the order of the trial court sustaining the motion to dismiss, and the case is remanded with instructions to reinstate the same for further proceedings as may be proper.
It is so ordered.
OMAN and WOOD, JJ., concur.
