If Gastly (Fossil) uses Lick and Knocks Out the other Pokémon, does your opponent bring out another Pokémon and then you do the status effect?
No, a Pokémon is SLATED to be removed when it has sufficient damage assigned to it. Attack effects resolve BEFORE a replacement Pokémon is brought up.
Source: WotC Chat (2000-08-31)