In battle
When a Pokémon with Moxie directly causes another Pokémon (including allies) to faint by using a damaging move, its Attack is increased by one stage. If its Attack is already at +6 stages, Moxie will not activate.
Moxie activates after the Pokémon gains Attack from Fell Stinger. If a Pokémon with Moxie defeats a Pokémon with Mummy using a contact move, the Pokémon's Ability will become Mummy before Moxie has the opportunity to activate.
Generation V
Moxie will activate even if the Pokémon fainting ends the battle.
Generation VI onward
If the Pokémon fainting ends the battle, Moxie will not activate.
Outside of battle
Moxie has no effect outside of battle.