Graphitic carbon nitride (g-C3N4) materials with a layered structure have unusual physicochemical properties. Herein it was shown that g-C3N4 quantum dots (QDs) obtained through a thermal-chemical etching route exhibited attractive upconversion and electrochemiluminescence (ECL) properties. After modification on nanoporous gold (NPG) with a sponge-like porous structure, g-C3N4 QDs were employed to fabricate an ECL sensor for the determination of Pb(2+) using target - dependent DNAzyme as the recognition unit. Moreover, magnetic reduced graphene oxide nanosheets (rGO) attached with Fe3O4 nanoparticles (rGO-Fe3O4) were obtained via a one-pot in situ reduction approach, and used as carriers of DNAzyme. To make full use of the unique magnetic property the prepared rGO-Fe3O4, a flow injection ECL detecting cell was designed using indium tin oxide (ITO) glass as working electrode. Due to the unique separation and enrichment properties of magnetic Fe3O4-rGO materials as well as wire-like conductivity of NPG, high sensitivity and selectivity for the determination of Pb(2+) in real water samples were achieved. This indicates that g-C3N4 has excellent anodic ECL performance in the presence of triethanolamine, and could be applied in real environmental samples analyses. Graphical Abstract Graphitic carbon nitride based electrochemiluminescence sensor for the sensitive monitor of lead(II) ions in real samples was constructed.