We have studied the spin dynamics of a dense two-dimensional electron gas confined in a GaAs/AlGaAs triple quantum well by using time-resolved Kerr rotation and resonant spin amplification. Strong anisotropy of the spin relaxation time up to a factor of 10 was found between the electron spins oriented in-plane and out-of-plane when the excitation energy is tuned to an exciton bound to neutral donor transition. We model this anisotropy using an internal magnetic field and the inhomogeneity of the electron g-factor. The data analysis allows us to determine the direction and magnitude of this internal field in the range of a few mT for our studied structure, which decreases with the sample temperature and optical power. The dependence of the anisotropic spin relaxation was directly measured as a function of several experimental parameters: excitation wavelength, sample temperature, pump-probe time delay, and pump power.