*555“ ‘[Ujnder res judicata, or claim preclusion, a valid final judgment bars future actions between the same parties on the same cause of action’ ” (Maurischat v County of Nassau, 81 AD3d 793, 793 [2011], quoting Landau, P.C. v LaRossa, Mitchell & Ross, 11 NY3d 8, 12 [2008]). Here, neither the plaintiff nor its predecessors in interest were parties to the prior foreclosure action, in which the defendants Wells Fargo Home Mortgage, Inc. (hereinafter Wells Fargo Home), and Wells Fargo Bank, N.A. (hereinafter Wells Fargo Bank) (hereinafter together the Wells Fargo defendants), were parties. Accordingly, contrary to the plaintiff’s contention, the Wells Fargo defendants are not precluded by the doctrine of res judicata from litigating the priority of their mortgages as against the plaintiffs mortgage in this action (see City of New York v Welsbach Elec. Corp., 9 NY3d 124, 127-128 [2007]).
Additionally, even if, as the plaintiff contends, its predecessor in interest, nonparty Greenpoint Mortgage Funding, Inc., was a necessary party to the prior foreclosure action (see RPAPL 1311), “[t]he absence of a necessary party in a mortgage foreclosure action simply leaves that party’s rights unaffected by the judgment of foreclosure and sale” (Glass v Estate of Gold, 48 AD3d 746, 747 [2008]).
Furthermore, the judgment of foreclosure and sale in the previous action, which barred all defendants therein from asserting, inter alia, any rights, claims, and interest in the subject property, does not preclude the Wells Fargo defendants from advancing their claims here, as the foreclosure sale of the premises ultimately was not conducted (see Nutt v Cuming, 155 NY 309, 313 [1898] [“A judgment entered in a foreclosure action is final for all purposes of review, but in other respects it is *556interlocutory . . . The provision barring others of their interest in, or of their rights of equity of redemption in the mortgaged premises, of necessity relates to the final concluding act, that of a sale of the premises”]; cf. Forbes v Aaron, 81 AD3d 876, 877 [2011]; Bethel United Pentecostal Church v Westbury 55 Realty Corp., 304 AD2d 689, 692-693 [2003]).
Moreover, contrary to the plaintiffs contention, the doctrine of judicial estoppel is not applicable here. “The doctrine of judicial estoppel precludes a party from taking a position in one legal proceeding which is contrary to that which he or she took in a prior proceeding, simply because his or her interests have changed” (Matter of New Cr. Bluebelt, Phase 4, 79 AD3d 888, 890 [2010]). Contrary to the plaintiffs contention, no position advocated by the Wells Fargo defendants in the prior foreclosure action is contrary to their position here with regard to the priority of their mortgages in relation to the plaintiffs mortgage. Accordingly, the Wells Fargo defendants are not precluded by the doctrine of judicial estoppel from advancing their contentions here concerning the priority of their mortgages in relation to the plaintiffs mortgage.
Therefore, based on the foregoing, the Supreme Court erred in granting that branch of the plaintiffs motion which was to strike the affirmative defenses and counterclaims asserted in Wells Fargo Home’s second amended answer.
The Supreme Court improvidently exercised its discretion in denying those branches of the Wells Fargo defendants’ cross motion which were to vacate Wells Fargo Bank’s default in answering the complaint and to deem Wells Fargo Home’s second amended answer timely served on behalf of Wells Fargo Bank as well as Wells Fargo Home pursuant to CPLR 3012 (d). “A defendant seeking to vacate a default in appearing or answering must demonstrate a reasonable excuse for the default and a potentially meritorious defense to the action” (Citimortgage, Inc. v Brown, 83 AD3d 644, 644 [2011]; see CPLR 5015 [a] [1]). Contrary to the plaintiffs contention, the Wells Fargo defendants established a reasonable excuse for Wells Fargo Bank’s default in answering the complaint. The Wells Fargo defendants also demonstrated a potentially meritorious defense, as they established that Wells Fargo Bank’s mortgage was recorded prior to the plaintiffs mortgage (see generally Real Property Law § 291; Lend-Mor Mtge. Bankers Corp. v Nicholas, 69 AD3d 680, 680 [2010]). Accordingly, the Supreme Court improvidently exercised its discretion in denying those branches of the Wells Fargo defendants’ motion which were to vacate Wells Fargo Bank’s default and to deem Wells Fargo Home’s second amended *557answer timely served on behalf of Wells Fargo Bank as well as Wells Fargo Home pursuant to CPLR 3012 (d), particularly in light of the strong public policy favoring the resolution of actions on their merits and the absence of prejudice to the plaintiff (see Westchester Med. Ctr. v Allstate Ins. Co., 80 AD3d 695, 697 [2011]).
The plaintiff failed to establish its prima facie entitlement to judgment as a matter of law. In support of its motion for summary judgment, the plaintiff submitted the assignment of the mortgage and note to it, as well as evidence that the borrowers were in default (see generally Rossrock Fund II, L.P. v Osborne, 82 AD3d 737, 737 [2011]). However, the plaintiff also submitted evidence that established that the Wells Fargo Bank mortgage may have priority over the plaintiffs mortgage. In addition, with respect to the applicability of the doctrine of equitable subrogation, the plaintiff submitted evidence that raised a triable issue of fact as to whether proceeds of the Wells Fargo Home mortgage were used to satisfy a prior mortgage on the premises which was superior in priority to the plaintiff’s mortgage (see Countrywide Home Loans Inc. v Dombek, 68 AD3d 1041, 1042 [2009]). Given the existence of triable issues of fact as to whether at least a portion of the Wells Fargo Home mortgage had priority over the plaintiffs mortgage as a result of an equitable lien, and whether the Wells Fargo Bank mortgage is superior in priority to the plaintiffs mortgage, the Supreme Court erred in granting those branches of the plaintiff’s motion which were for summary judgment on the complaint insofar as asserted against the Wells Fargo defendants, and for an order of reference. Angiolillo, J.P, Dickerson, Hall and Roman, JJ., concur.