Cause and Effect (TNG). I had forgotten that Dr. Crusher played a significant role in the episode. She was the one that figured most prominently in realizing that events were repeating.
And then at the end with Capt. Bateson I saw two female officers behind him yet in Diane Carey's novel Ship of the Line the USS Bozeman has an all male crew which is another reason to hate that crappy book. It doesn't even fit canon.