We study the spectral dependence of the second harmonic generation (SHG) emitted by gold thin films around percolation. Previous studies found that the SHG peaks sharply at the percolation regime, i.e., at the critical layer thickness where the static permittivity of the film diverges. Another important characteristic is the very large field enhancement obtained in the regime of almost touching particles, while the thin film does not behave as a metal yet. Here, we show that these properties and, in particular, the amount of SHG extracted are wavelength-dependent. We investigate experimentally the evolution of the SHG as a function of the critical thickness of the film for four different applied fundamental wavelengths. A spectral dependence of the SHG is found, and a simple model is presented that qualitatively reproduces the variations of the measured SHG. We find that the local field enhancement at the fundamental wavelength dominates the signal and also that external factors play a role, such as the film absorbance. These results are particularly interesting for applications requiring an optimization of the SHG.