In vivo tumor imaging with nanoprobes suffers from poor tumor specificity. Here, we introduce a nanosystem, which allows selective background quenching to gain exceptionally tumor-specific signals. The system uses near-infrared quantum dots and a membrane-impermeable etchant, which serves as a cation donor. The etchant rapidly quenches the quantum dots through cation exchange (ionic etching), and facilitates renal clearance of metal ions released from the quantum dots. The quantum dots are intravenously delivered into orthotopic breast and pancreas tumors in mice by using the tumor-penetrating iRGD peptide. Subsequent etching quenches excess quantum dots, leaving a highly tumor-specific signal provided by the intact quantum dots remaining in the extravascular tumor cells and fibroblasts. No toxicity is noted. The system also facilitates the detection of peritoneal tumors with high specificity upon intraperitoneal tumor targeting and selective etching of excess untargeted quantum dots. In vivo cation exchange may be a promising strategy to enhance specificity of tumor imaging.