Generation IV
When using a move, Rivalry raises the power of the move by 25% if the target and the Pokémon with this Ability have the same gender, but reduces base power by 25% if the target and the Pokémon with this Ability have opposite genders.
Rivalry reduces base power when a Pokemon with Rivalry uses an attack on a Pokemon with the opposite gender in all generations, not just Gen 7.
Source