A novel Zn(II) coordination polymer, {[Zn4(BTEC)3][(3-BCBPY)2]·5H2O}n (compound 1), was synthesized based on viologen ligand (3-BCBPY·2Cl = 1,1′-bis(3-cyanobenzyl)-4,4′-bipyridinium chloride), benzoic acid (H4BTEC = 1,2,4,5-benzenetetracarboxylic acid) and ZnCl2. Single crystal X-ray diffraction analysis revealed that the Zn(II) ions are bridged by BTEC4− anions, giving rise to a 3D structure, with the 3-BCBPY2+ cations occupying the pores within the channels of compound 1. This compound displays photoactivity, undergoing significant color transformations under ultraviolet light irradiation. Furthermore, to gain a deeper theoretical understanding of the color-changing behavior of compound 1, time-dependent density functional theory (TDDFT) was employed. Additionally, compound 1 demonstrates ammonia vapor sensing capabilities, along with intriguing light-modulated luminescence properties. Notably, it also exhibits significant sensing abilities for Fe3+ and Cr2O72− ions, even at low concentrations (10−5 M). This compound not only showcases its applications in the realms of photochromism, but also explores its potential in ammonia vapor detection and ion sensing.