AMENDED SUMMARY ORDER
In October 2003, plaintiff-appellant Ack-leema Ally, pro se, filed a civil complaint seeking damages of approximately $40 million against various defendants for the violation of Section 853 of the New York Real Property Actions and Proceedings Law. In November 2003, the United States District *195Court for the Eastern District of New York sua sponte dismissed the complaint on the grounds of lack of subject matter jurisdiction, pursuant to Rule 12(h)(3) of the Federal Rules of Civil Procedure.
We review orders dismissing complaints for lack of subject matter jurisdiction de novo. See S.E.C. v. Berger, 322 F.3d 187, 191 (2d Cir.2003). Although we construe a pro se plaintiffs complaint liberally, see Graham v. Henderson, 89 F.3d 75, 79 (2d Cir.1996), a plaintiff attempting to bring a case in federal court must still comply with the relevant rules of procedural and substantive law, including establishing that the court has subject matter jurisdiction over the action. See Traguth v. Zuck, 710 F.2d 90, 95 (2d Cir.1983).
The district court concluded that it lacked subject matter jurisdiction for two reasons: First, pursuant to the Rooker-Feldman doctrine, see Rooker v. Fidelity Trust Co., 263 U.S. 413, 415-16, 44 S.Ct. 149, 68 L.Ed. 362 (1923); District of Columbia Court of Appeals v. Feldman, 460 U.S. 462, 486-87, 103 S.Ct. 1303, 75 L.Ed.2d 206 (1983), it did not have jurisdiction over claims that effectively challenge state court judgments; and, second, Ally’s complaint fails to establish federal question jurisdiction in that her claims, which are based on a landlord-tenant dispute, are fundamentally a matter of state, and not federal, law.
Because the jurisdiction of the federal courts is limited and does not extend to the claims in this case, the district court was correct in dismissing Ally’s complaint. Even though Ally has attempted to state her claims in order to make them appear to arise under the U.S. Constitution, the “essence” of her claims remains unchanged. Anderson v. Bowen, 881 F.2d 1, 5 (2d Cir.1989). Her complaint arises out of a landlord-tenant dispute over which the federal courts simply have no jurisdiction. See DiNapoli v. DiNapoli, No. 95 Civ. 7872, 1995 WL 555740, at *1, 1995 U.S. Dist. LEXIS 13522, at *4 (S.D.N.Y. Sept.19, 1995). ‘Where jurisdiction is lacking ... dismissal is mandatory.” United Food & Commercial Workers Union, Local 919, AFL-CIO v. CenterMark Properties Meriden Square, Inc., 30 F.3d 298, 301 (2d Cir.1994). Thus, we are unable to adjudicate the merits of Ally’s case, and must affirm the district court’s dismissal of her complaint.
Moreover, we agree with the district court’s decision to deny Ally leave to amend her complaint after concluding that any amendment could not save Ally’s complaint from dismissal for lack of subject matter jurisdiction.
Accordingly, the judgment of the district court is hereby AFFIRMED.