A novel fluorescent switchable rotaxane NIR4 composed of two different molecular stations and rotaxane arms terminated with far-red boron-dipyrromethene (BODIPY) fluorophores and its derivatives were synthesized by CuAAC click chemistry. The molecular shuttling motion of mechanically interlocked molecules (MIMs) could be addressed by the fluorescence signal transduction via distance dependent photo-induced electron transfer process of rotaxane NIR4 triggered by external chemical stimuli of acid/base. Moreover, the flexible arms of triazolium moiety in rotaxane NIR4 and its axle NIR2 exhibited impressive selectivity and sensitivity toward complementary anionic analyte (H2PO4 −), where the specific mechanical molecular motion was supported by quantum mechanical calculations. The development of rotaxane NIR4 with a high level of structural complexity can be utilized for novel dual sensory detections of acid-base and dihydrogen phosphate (H2PO4 −) anion. Importantly, the host of NIR2 and rotaxane NIR4 could be applied for the vitro imaging and clarify the distribution of H2PO4 − at subcellular levels.