In recent generations you gain exp when you catch a Pokémon. So I’m just wondering if that means the Pokémon involved will still gain EV’s even if the opponent isn’t being KO’d.
Yes, as long as a Pokemon is gaining experience, it will gain EVs. (Except with Rare/Exp Candies, Poke Jobs, ect. Just from battles and vitamins and Poke jobs that give EVs.)
Source: Experience. (No pun intended)