It works indirectly. The system goes more or less like this (simplified):
Hypothalamus ---((Gonadotropin-releasing hormone)) ---> Pituitary
Anterior pituitary ---((LH / FSH )) ---> Gonads release hormones
LH in males triggers the production of T in the Leydig cells of the testis. In females, makes the ovary release an egg.
FSH in males is necessary to produce spermatozoa. In females, causes the follicle to mature (necessary for the egg).
Both mechanisms are regulated through feedback: if there is evidence the body has responded to either, the production of LH is slowed.
Since the feedback signal doesn't consider which sex hormone is present, if you have enough estrogens in your system the signal will go back to the hypothalamus saying: "enough," the GnRH pulses will slow down, the production of LH will also slow down, and production of T and (eventually) sperm will slow down and it may even stop.
The canonical study for it is:
Prior, J.C., Vigna, YM., & Watson, D. (1989).
Spironolactone with physiological female gonadal steroids in the presurgical therapy of male to female transsexuals: A new observation. Archives of Sexual Behavior,
18, 49-57.
The current view is, of course, a lot more complicated. LH and FSH act in sequence: LH first, to release the egg or raise T, after FSH to make the follicle mature or form the spermatozoa. The sequence is modulated by a careful interaction of several polypeptide signals, and the fact that those interactions happen mostly at the hypothalamus level for LH and partially at the pituitary level for FSH.
If you want to make your way through the current view, this is a good starting point:
http://www.pnas.org/content/92/13/5813.abstract