Various types of Lewis bases have been employed to enhance the performance and stability of perovskite solar cells (PSCs) by passivating the active layer. The cyano (CN) group is a weak Lewis base, the effect of which on the passivation of the perovskite layer is unclear. In this study, we employed simple CN-containing compounds, specifically three isomers of dicyanobenzene (DCB) (1,2-DCB, 1,3-DCB, and 1,4-DCB), as passivation agents for the perovskite layer. Our investigation revealed that these compounds exhibited notable interactions with the perovskite film. They effectively removed residual lead iodide, enhanced crystallinity, enlarged perovskite grain size, and reduced trap density. Consequently, these enhancements resulted in a significant increase in the power conversion efficiency (PCE) and ambient storage stability of the passivated PSCs. Among the three DCB isomers, 1,3-DCB demonstrated the most effective passivation, leading to a remarkable increase in PCE, with a maximum of 21.07%, compared to a PCE of 18.33% for the non-passivated cell. These results confirm that the basic cyano (CN) group efficiently interacts with Pb2+ ions and suggest that CN-containing compounds may represent a promising class of passivation agents for achieving high-performance and stable PSCs. Dicyanobenzene (DCB), a weak Lewis base, effectively passivates perovskite films by eliminating residual PbI2, enhancing crystallinity, and reducing trap state density, thus enhancing perovskite solar cell performance and stability.