normalize dependent variable with respect to one independent variable
Though continuum regression methods appear to be significantly different from binary classification methods, the crux of the difference is usually tied up in a sigmoid function.

$$S(t)=\frac{1}{1+e^-t}$$

Sigmoid literally means sigma like or "S" like, as becomes obvious in looking at its graphical representation:



The sigmoid provides a tractable means to map from continuum analytics into discrete space while retaining differentiability and integrability needed for some theoretical derivations.  

The important part is that in classification methods, one has to choose a threshold value of the sigma function for mapping to a 0 or 1.  This is overwhelmingly chosen as 0.5, but there are cases of unbalanced classes where other values might work better.

That said, you should be able to proceed exactly as you have already suggested: "I would have simply divided it by the respective averages and removed the effect."  Do this, but then you have to turn the results back into 0's and 1's by choosing where your cutoff threshold lies.

Hope this helps!