Magnetic phase transition under hydrostatic pressure in TlCu$_{0.988}$Mg$_{0.012}$Cl$_3$ was investigated by magnetization measurements. The parent compound TlCuCl$_3$ is a coupled spin dimer system, which undergoes a pressure-induced quantum phase transition from a gapped ground state to an antiferromagnetic state at $P_{rm c} = 0.42$ kbar due to the shrinkage of the gap. At ambient pressure, the present doped system exhibits impurity-induced magnetic ordering at $T_{rm N}=2.5$ K. With increasing pressure, $T_{rm N}$ increases. This is because the effective exchange interaction $J_{rm eff}$ between unpaired spins is enhanced by the shrinkage of the gap. With a further increase in pressure, the present system undergoes a phase transition to a uniform antiferromagnetic phase due to the closing of the triplet gap in the intact dimers. The crossover from the impurity-induced ordered phase to the uniform antiferromagnetic phase occurs at $P simeq 1.3$ kbar.