Technological advances and methodological innovations in cell signaling pathway analysis will facilitate progress in understanding biological processes, intervening in diseases, and screening drugs. In this work, an elaborate strategy for visualizing and monitoring the transient receptor potential melastatin 7 (TRPM7)-Mg2+ signaling pathway in living cells was constructed through the logical analysis of upstream mRNA and downstream molecules by two individual DNA sensors. The DNA sensors are constructed by modifying the dye-labeled DNA sequences on the surface of gold nanoparticles. By hybridizing with upstream mRNA, Cy5-modified DNA sensor 1 can detect and silence it simultaneously, outputting a red fluorescence signal. When the upstream mRNA is silenced, the concentration of downstream molecules of Mg2+ will be affected and down-regulated. The FAM-modified DNA sensor 2 detects this change and emits a green fluorescence as a signal. Therefore, the dynamic information on TRPM7 mRNA and the Mg2+-mediated signaling pathway can be successfully obtained by fluorescence imaging methods. Furthermore, the TRPM7 mRNA-Mg2+ signaling pathway also affects cell activity and migratory function through cell scratching and other experiments. More importantly, the proposed sensor also shows potential for screening signaling pathway inhibitors. Our work provides a simple and general strategy for the visualization of signaling pathways, which helps to understand the changes in the physiological activities of cancer cells and the causes of carcinogenesis and is crucial for cancer diagnosis and prognosis.