Standing is in the nature of an affirmative defense to be pleaded and proved. There is no requirement that a plaintiff allege standing in the complaint.
Wilmington Sav. Fund Socy., FSB v. Matamoro, NY Slip Op 05741 (2d Dep't October 20, 2021)
Here is the decision.