> To survive natural selection the gene must give the animal some reproductive advantage.
Most probably, but not necessarily.
A gene can be present without being useful because it is linked to another gene that is itself useful; or it can be a leftover from an earlier moment of evolution where it was useful, and then it ceased to be useful but there was never an evolution pressure strong enough to have it disappear.
In summary, just because a gene is present and active does not mean it's useful today.