The Gemara in several places (BM 48b and 62a, Yevamos 22b, Sanhedrin 85a, BB 4a, BK 94b, Makkos 8b) quotes the exposition
ונשיא בעמך לא תאור - בעושה מעשה עמך
“A prince in your people you shall not curse” - when he does the actions of your people
The term עמך is used regarding many mitzvos, not just the one in question - Tzedakah (Shemos 22:24), Shemitah (Shemos 23:11), Rechilus (Vayikra 19:16), and revenge and bearing a grudge (Vayikra 19:18) are just a few off the top of my head.
We even see in the Pesukim that the term is used this way, even not in conjunction with ונשיא בעמך לא תאור. Throughout the story of Yetzias Mitzraim, Hashem tells Moshe, and Moshe tells Paroh, to send “My nation” out of Mitzraim (Shemos 3:7, 3:10, 5:1, 7:4, 7:16, 7:26, 8:16, 8:17, 9:1, 9:13, 10:3, 10:4). Guess who leaves? Not all the Jews - just the 20% of them who wanted to leave and join Hashem’s nation (Rashi to Shemos 13:18). Perhaps we see from here that when the word עמי or עמך is used, it only refers to those who are עושה מעשה עמך, just as by Yetzias Mitzraim, only those who were בעושה מעשה עמך actually left.
In terms of practical Halacha, do we apply the exposition of עושה מעשה עמך to these mitzvos as well? For instance, is there still an obligation to give a poor person tzedakah if he is a Rasha? Does the exposition apply anywhere that the term עמך appears, or can we only apply it where we have a tradition that it can be applied?
I should clarify: Even if the Halacha is that there is no obligation to give tzedakah to wicked poor people, I’m only looking for answers that derive this Halacha specifically from the term עמך.