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. Starting from Pokémon X and Y, if the Pokémon fainting ends the battle, Moxie will not activate.