A class of algorithms based on subspace projection is widely used in the denoising of magnetoencephalography (MEG) signals. Setting the dimension of the interference (external) subspace matrix of these algorithms is the key to balancing the denoising effect and the degree of signal distortion. However, most current methods for estimating the dimension threshold rely on experience, such as observing the signal waveforms and spectrum, which may render the results too subjective and lacking in quantitative accuracy. Therefore, this study proposes a method to automatically estimate a suitable threshold. Time-frequency transformations are performed on the evoked state data to obtain the neural signal of interest and the noise signal in a specific time-frequency band, which are then used to construct the objective function describing the degree of noise suppression and signal distortion. The optimal value of the threshold in the selected range is obtained using the weighted-sum method. Our method was tested on two classical subspace projection algorithms using simulation and two sensory stimulation experiments. The thresholds estimated by the proposed method enabled the algorithms to achieve the best waveform recovery and source location error. Therefore, the threshold selected in this method enables subspace projection algorithms to achieve the best balance between noise removal and neural signal preservation in subsequent MEG analyses.