Rapid detection of heavy metal ions in PM2.5, especially Hg2+ and Pb2+, is a crucial analytical topic. Herein, a new pyrene-based hydrogen-bonded organic framework (Py-HOF) with very superior electrochemiluminescence (ECL) is developed, and a dual-wavelength ratiometric ECL sensor based on perfectly matched wavelength and energy transfer of Py-HOF and RuSiO2 was constructed to detect dual-target heavy metals. By designing Hg2+ triggered enzymatic amplification to release DNA 1, the RuSiO2 ECL probe was introduced onto the Py-HOF-modified electrode, so ECL of Py-HOF decreased and RuSiO2 ECL increased for Hg2+ detection. Furthermore, specific recognition of Pb2+ to the DNA enzyme capture strand induced increased ECL signal of Py-HOF and decreased ECL of RuSiO2 for Pb2+ assay. The work develops a HOF material and applies to a novel dual-wavelength ECL sensor for detecting two heavy metals in PM2.5 for the first time, which opens a promising ECL strategy with improved accuracy for environmental monitoring and assay.