In an action, inter alia, pursuant to RPAPL article 15 to establish the plaintiffs’ right to an easement, the plaintiffs appeal from a judgment of the Supreme Court, Suffolk County (Pitts, J.), dated June 18, 2008, which, upon an order of the same court dated April 7, 2008, granting the defendants’ motion to dismiss the complaint pursuant to CPLR 3211 (a) (5) on the ground the action is barred by the doctrine of res judicata, is in favor of the defendants and against them, dismissing the complaint.
Ordered that the judgment is reversed, on the law, with costs, the motion is denied, the order dated April 7, 2008 is modified accordingly, and the matter is remitted to the Supreme Court, Suffolk County for further proceedings, on the complaint.
The plaintiffs and two others commenced a prior action seeking to compel the defendants and the Building Inspector of the Village of Westhampton Dunes to process and grant their application for a building permit for the construction of a walkway on an easement over land owned by the defendant Elizabeth Hale’s predecessor-in-title and adjacent to land owned by the defendants Jonathan D. Polkes and Ellen G. Polkes. In that action, the Supreme Court granted that branch of the defendants’ motion which was to dismiss the complaint pursuant to CPLR 3211 (a) (7) for failure to state a cause of action (see Feder v Polkes, 67 AD3d 727 [2009] [decided herewith]). Thereafter, the plaintiffs commenced the instant action *727pursuant to RPAPL article 15, inter alia, to establish their right to the easement.
The Supreme Court incorrectly determined that the complaint in this action is barred by the doctrine of res judicata. Under the doctrine of res judicata, a final adjudication of a claim on the merits precludes relitigation of that claim and all claims arising out of the same transaction or series of transactions by a party or those in privity with a party (see Gramatan Home Invs. Corp. v Lopez, 46 NY2d 481, 485 [1979]; see also Winkler v Weiss, 294 AD2d 428 [2002]). Where a dismissal does not involve a determination on the merits, the doctrine of res judicata does not apply (see Maitland v Trojan Elec. & Mach. Co., 65 NY2d 614 [1985]; Sclafani v Story Book Homes, 294 AD2d 559, 559-560 [2002]). The complaint in the prior related action was dismissed on the ground that it did “not contain any factual averments against” Jonathan D. Polkes, Ellen G. Polkes, and Megan Strecker. “Rather, the conduct complained of involves only the Village [of Westhampton Dunes and its officials]” (Feder v Polkes, 67 AD3d 727 [2009] [decided herewith]). Therefore, the dismissal was not on the merits, and the doctrine of res judicata does not apply in the instant case (see Maitland v Trojan Elec. & Mach. Co., 65 NY2d 614 [1985]).
We do not consider the defendants’ contention that the plaintiffs failed to join necessary parties since it was improperly raised for the first time in their reply papers before the Supreme Court (see Crummell v Avis Rent A Car Sys., Inc., 62 AD3d 825 [2009]; Luft v Luft, 52 AD3d 479, 480 [2008]; Medugno v City of Glen Cove, 279 AD2d 510, 511-512 [2001]). Skelos, J.P., Santucci, Belen and Hall, JJ., concur.