Positively charged nanofiltration (NF) membranes are widely used to separate Li+ and Mg2+, which play an important role in extracting lithium from salt lakes. Despite its widespread use, the polyethyleneimine-trimesoyl chloride (PEI-TMC) membrane has attracted attention due to its limited permeance and separation efficiency. To address these challenges, we introduced amine-functionalized titanium dioxide (TiO2-NH2) nanoparticles into the interfacial polymerization (IP) reaction. The introduction of TiO2-NH2 reduced the diffusion rate of PEI and formed nanoscale water channels in the polyamide (PA) layer. This modification effectively modulated the structure of the NF membrane. The NF membrane exhibited high water permeance (9.65 L·m−2·h−1·bar−1) and Li+/Mg2+ selectivity (SLi, Mg = 16.31) when 0.03 wt% TiO2-NH2 was used. The DLVO theory and transition state theory showed that the introduction of TiO2-NH2 improved the rejection of Li+ and Mg2+ by the membrane. Furthermore, the optimized NF membranes demonstrated excellent stability during long-term filtration and in the mixed salt solutions with varying Mg2+/Li+ mass ratios. This work is of great significance for designing and advancing membrane materials that facilitate the efficient separation of lithium from salt lakes with high Mg2+/Li+ mass ratios.