With the aim to develop a novel multifunctional gene delivery system that may overcome the common barriers of gene transfection, near-infrared fluorescent triphenylamine-pyrazine was modified with a DNA condensing triazole-[12]aneN3 moiety through different length alkyl ester linkages to afford three new non-viral gene vectors, TDM-A/B/C. All compounds showed prominent solvatochromic fluorescence (Stokes shift of up to 383 nm) and two-photon absorption properties (σ2P to 101 GM), and exhibited strong aggregation-induced emission (AIE). Gel electrophoresis demonstrated that plasmid DNA was completely condensed at a concentration of 10 μM (TDM-A), 14 μM (TDM-B) and 16 μM (TDM-C), and released in esterase and acidic environment. SEM demonstrated that the three compounds were able to self-assemble and co-aggregate with DNA to form regular nanoparticles. Experiments demonstrated that TDM-A/B/C was able to integrate with DNA through electrostatic interactions and supramolecular stacking, and the short alkyl linkage favored the strong interaction with DNA. Among the three compounds, TDM-B showed the best luciferase and GFP transfection activities in the presence of DOPE, which were 156% and 310% higher than those of Lipo2000, respectively. The transfection process of DNA was clearly traced through one- and two-photon fluorescence microscopy imaging. Cellular uptake inhibition assay indicated that the DNA complex entered the cell mainly via clathrin-independent endocytosis. Furthermore, the in vivo transfection experiments of TDM-B/DOPE were successfully implemented in zebra fish embryos, and the GFP gene expression level was superior to that of Lipo2000 (200%). Finally, this study clearly unraveled that the length of the alkyl linkage affected the DNA condensation and transfection activity, which can serve as a base for the future rational design of non-viral gene vectors.