A new salicylaldehyde-based azo dye 5-azotriazolyl-3-methoxysalicylaldehyde (H2TMSA) and its two Ln3+ complexes {[Ln(HTMSA)3(H2O)2][Ln(HTMSA)3(DMF)(H2O)]}·15H2O (Ln = Dy(1) and Tb(2)) have been synthesized and characterized by IR, Raman, 1H NMR and single-crystal X-ray diffraction techniques. H2TMSA shows an azo form in acidic (pH < 5.05) and strong basic (pH > 12.41) conditions, and a pH-dependent azo-hydrazone tautomerism in the range of pH 5.05 to 12.41, which is demonstrated by the time-dependent density functional theory (TD-DFT) calculations. Single-crystal X-ray diffraction reveals that 1 and 2 are isostructural complexes in which the Ln3+ ions are surrounded by six oxygen atoms from three dichelate HTMSA- ligands and two oxygen atoms from two solvent molecules forming a distorted square-antiprismatic geometry. Complex 1 shows distinct slow magnetic relaxation under a zero dc field, while 2 displays field-induced slow magnetic relaxation. Ab initio calculations were performed on the two complexes to understand their magnetic anisotropy and their different magnetic dynamics.