I see the reasoning behind this advice but i) this person should have explained it better to you and ii) they should have also mentioned the restrictive assumptions underlying this idea.
In the Hausman test you generally ask whether there is a difference between a consistent but inefficient model and a potential inconsistent model which is more efficient. In the standard case where you compare fixed and random effects the fixed effects estimator is consistent whether or not the individual effects are correlated with the other explanatory variables but it is less efficient than the random effects estimator which is only consistent for uncorrelated fixed effects with the explanatory variables.
Either of the two groups (male or female) will have fewer observations. A priori I would guess that this is the female group. So if you run the same regression specification
$$y_{it} = \alpha + X‘_{it}\beta + c_i + \epsilon_{it}$$
where $y$ is earnings, $X$ are the same time-variant explantory variables, $c_i$ are the individual fixed effects and $\epsilon$ is a stochastic error, then a difference between the male and female models would imply that there is a different treatment of men and women in terms of wages. The test statistics in this case would be
$$H = (\beta_{fem} - \beta_{male})'(Var(\beta_{fem}) - Var(\beta_{male}))(\beta_{fem} - \beta_{male})$$
However, and this is an important point, this whole reasoning is only true if the two models are correctly specified. It should be easy to come up with omitted gender-specific variables that are time-variant and that affect wages, e.g. child birth. This immediately breaks the main assumption of this idea so I would be careful with that.