Single-walled carbon nanotubes (SWCNTs) are wrapped with single-stranded DNA (ssDNA) to create near-infrared (NIR-II) fluorescent sensors for diverse analytes. However, the interaction between the negatively charged backbone of ssDNA and cations in biological saline alters fluorescence unpredictably. This susceptibility limits the application of these sensors in biological media. To address this limitation, this study develops a cation-pretreatment strategy that quenches the baseline fluorescence of ssDNA-SWCNTs to enable turn-on responses that are selectively triggered by analytes in saline. An initial screening of Na+, K+, Mg2+, Ca2+, and Al3+ pretreatments of gel-encapsulated (AT)15-SWCNTs reveals that Al3+ pretreatment induces a stable quenching of fluorescence that is reversible only on Al3+ chelation or precipitation. We apply this Al3+ pretreatment to develop a saline-resilient, near-infrared sensor for dopamine. The Al3+-treated (AT)15-SWCNTs show a concentration- and chirality-dependent fluorescence response over a dynamic range of 1 nM and 10 μM dopamine, achieving a 110-fold increase in the turn-on response to 10 mM dopamine in buffered saline compared with the untreated (AT)15-SWCNTs. Further study of the effects of pH and different salts on the dopamine response suggests a mechanism that relies on competing trivalent cations and negative DNA phosphate interactions. These interactions lay the framework for saline-resilient optical sensors that exploit DNA as a charged-based actuator for modulating the exciton dynamics and controlling the SWCNT fluorescence.