Cohen & Frey P.C., Ardmore, Pennsylvania (Timothy L. Frey, Admitted Pro Hac Vice, of Counsel), and Zdarsky, Sawicki & Agostinelli LLP, Buffalo, for Defendant-Appellant. Lipsitz Green Scime Cambria LLP, Buffalo (Joseph J. Manna of Counsel), for Plaintiff-Respondent. Adams Leclair LLP, Rochester (Theodore M. Baum of Counsel), for Intervenor-Respondent. Appeal from an order of the Supreme Court, Erie County (Timothy J. Walker, A.J.), entered April 13, 2023. The order granted plaintiff’s motion seeking leave to file and serve a first amended complaint and granted Philadelphia Indemnity Insurance Company’s motion to intervene. It is hereby ORDERED that the order so appealed from is unanimously affirmed without costs. Memorandum: These consolidated appeals arise from a construction contract dispute between defendant Norfolk Southern Railway Company (Norfolk) and plaintiff, Resetarits Construction Corporation (RCC). In appeal No. 1, Norfolk appeals from an order that granted RCC’s motion for leave to file and serve a first amended complaint and further granted the motion of the surety on RCC’s performance bond, Philadelphia Indemnity Insurance Company (PIIC), to intervene in the action. In appeal No. 2, Norfolk appeals from an order that denied its motion to dismiss the third cause of action in the first amended complaint and, further, denied its motion to dismiss PIIC’s intervenor complaint. We affirm in both appeals. With respect to appeal No. 1, ” ‘[l]eave to amend a pleading should be freely granted in the absence of prejudice to the nonmoving party where the amendment is not patently lacking in merit’ ” (DiGiacco v. Grenell Is. Chapel, 210 AD3d 1466, 1467 [4th Dept 2022]; see CPLR 3025 [b]), and “the decision whether to grant leave to amend a [pleading] is committed to the sound discretion of the court” (Brooks v. City of Buffalo, 209 AD3d 1270, 1271 [4th Dept 2022] [internal quotation marks omitted]), the exercise of which “will not be lightly disturbed” (Yonkers Lodging Partners, LLC v. Selective Ins. Co. of Am., 158 AD3d 732, 735 [2d Dept 2018]). The first amended complaint sought to add a third cause of action, for a judgment declaring that Norfolk terminated the underlying contract improperly or for convenience, either of which would, inter alia, vitiate Norfolk’s counterclaim for breach of contract seeking cure damages (see Paragon Restoration Group, Inc. v. Cambridge Sq. Condominiums, 42 AD3d 905, 906 [4th Dept 2007]; Fruin-Colnon Corp. v. Niagara Frontier Transp. Auth., 180 AD2d 222, 233 [4th Dept 1992]). Inasmuch as the proposed amendment is not patently lacking in merit, we reject Norfolk’s contention that Supreme Court abused its discretion in granting RCC’s motion for leave to amend its complaint. Norfolk also contends that the court abused its discretion in granting PIIC’s motion to intervene because that motion was untimely. We reject that contention. “[A] timely motion for leave to intervene should be granted . . . where the intervenor has a real and substantial interest in the outcome of the proceedings” (Jones v. Town of Carroll, 158 AD3d 1325, 1327 [4th Dept 2018], lv dismissed 31 NY3d 1064 [2018] [internal quotation marks omitted]). ” ‘In examining the timeliness of [a] motion [to intervene], courts do not engage in mere mechanical measurements of time, but consider whether the delay in seeking intervention would cause a delay in resolution of the action or otherwise prejudice a party’ ” (id. at 1328). We conclude that the court properly granted PIIC’s motion inasmuch as PIIC’s intervention “will not delay resolution of the action and [Norfolk] will not suffer prejudice” (id.; see Poblocki v. Todoro, 55 AD3d 1346, 1347 [4th Dept 2008]; Matter of Norstar Apts. v. Town of Clay, 112 AD2d 750, 751 [4th Dept 1985]). With respect to appeal No. 2, Norfolk failed to preserve for our review its contention that RCC’s third cause of action seeking a declaratory judgment should be dismissed pursuant to CPLR 3211 (a) (4) because of a prior pending federal action between Norfolk and PIIC in which Norfolk seeks to enforce the surety bond (see generally Henry v. Buffalo Mgt. Group, Inc., 218 AD3d 1233, 1234 [4th Dept 2023]). We reject Norfolk’s contention that the court erred in denying its motion to dismiss the declaratory judgment cause of action pursuant to CPLR 3211 (a) (3) for lack of standing. “Where a CPLR 3211 (a) (3) motion is based upon an alleged lack of standing, the burden is on the moving defendant to establish, prima facie, the plaintiff’s lack of standing as a matter of law” (Wilmington Sav. Fund. Socy., FSB v. Matamoro, 200 AD3d 79, 89-90 [2d Dept 2021]). “To defeat a defendant’s motion to dismiss, the plaintiff has no burden of establishing its standing as a matter of law, but must merely raise a question of fact as to the issue” (id. at 90; see Borrelli v. Thomas, 195 AD3d 1491, 1494 [4th Dept 2021]). “Standing is an element of the larger question of justiciability . . . The various tests that have been devised to determine standing are designed to ensure that the party seeking relief has a sufficiently cognizable stake in the outcome so as to cast[ ] the dispute in a form traditionally capable of judicial resolution” (Community Bd. 7 of Borough of Manhattan v. Schaffer, 84 NY2d 148, 154-155 [1994] [internal quotation marks omitted]; see Smith v. Hurley, 221 AD2d 981, 982 [4th Dept 1995]). “The most critical requirement of standing . . . is the presence of injury in fact—an actual legal stake in the matter being adjudicated” (Alloway v. Bowlmor AMF Corp., 188 AD3d 1716, 1718 [4th Dept 2020], lv denied 36 NY3d 911 [2021] [internal quotation marks omitted]). Allegations in the first amended complaint that Norfolk’s termination of the underlying contract improperly or for convenience, inter alia, precludes Norfolk’s counterclaim and caused RCC to make payments to subcontractors for which it was not reimbursed raise an issue of fact whether RCC suffered an injury-in-fact. Finally, Norfolk contends that the court abused its discretion by denying its motion to dismiss PIIC’s intervenor complaint because of the prior pending federal action between Norfolk and PIIC. We reject that contention. CPLR 3211 (a) (4) ” ‘vests a court with broad discretion in considering whether to dismiss an action on the ground that another action is pending between the same parties on the same cause of action’ ” (Cellino & Barnes, P.C. v. Law Off. of Christopher J. Cassar, P.C., 140 AD3d 1732, 1734 [4th Dept 2016], quoting Whitney v. Whitney, 57 NY2d 731, 732 [1982]). ” ‘While complete identity of the parties is not a necessity for dismissal under [the statute] . . . , there must at least be a substantial identity of the parties which generally is present when at least one plaintiff and one defendant is common in each action’ ” (Matter of Witkowski v. HS 570, Inc., 218 AD3d 1230, 1232 [4th Dept 2023]). RCC is not a party in the federal action, and thus substantial identity of the parties is lacking. We therefore conclude that the court did not abuse its discretion in denying Norfolk’s motion to dismiss the intervenor complaint (see Ashwood v. Uber USA, LLC, 219 AD3d 1289, 1290 [2d Dept 2023]; cf. WYNIT, Inc. v. Smartparts, Inc., 74 AD3d 1720, 1720-1721 [4th Dept 2010]).