For example, if a Gumshoos fainted a Rattata in turn 1, and a Victreebel swaps in, does Stakeout's damage boost activate in turn 2?
Stakeout doesn't activate when a Pokemon replaces a fainted Pokemon, correct? Correct, only if a Pokémon is switched that turn (either manually or via a move).
source