I don't think it's clear whether or not gift Pokémon can be used, because the whole idea of the challenge is to use the Pokémon you've captured, but I think you can use gifted ones if you'd like. This is optional, I guess. And I don't think they would count as a Pokémon for that area, seeing as you didn't necessarily 'encounter' the Pokémon. Not so sure.

Like in the previous question, the whole idea of the challenge is to use only captured Pokémon, but I'm pretty sure you can use traded Pokémon as long as you had already captured the Pokémon necessary for the trade. For example, let's say an NPC wants to trade their Raticate for your Kadabra. You can only make this trade if you already had a Kadabra in your possession. You cannot go out and capture it and then trade. Hope that makes sense.

If you're interested about the specifics when it comes to the challenge, this website explains everything in detail.