This teaching can be found in the Buber printing of “Midrash Rabbah” on sefer “Tehillim”.
 The entire pasuk reads, “Why shall the strong one glorify himself with evil, [for] the kindness of G-d [extends throughout] the entire day?” (Tehillim: 52; 3)
According to RaSh”I, in this pasuk, David relates to Doeg, that if Doeg wishes to cause him to be derpived of food, there is no benefit to his having spoken Lashon HaRa concerning Achimelech who provided David food, for HaShem, through His kindness, will always make certain that there are people who will have mercy on David and provide him food.
Ibn Ezra teaches that David is telling Doeg that he should not glorify himself in his actions of evil against David, rather, it is appropriate for Doeg to praise HaShem Who’s kindness is present throughout the day.
The RaDa”K explains that Doeg was referred to as “gibor” – “strong one” as he was the Head of the Beis Din (Jewish Court). Similarly, Metzudas David notes that David is asking Doeg who is “the strong one in Torah” why he praises himself through the evil action that he has taken against David through having spoken Lashon HaRa against him and the kohanim of the city of Nov.
 This teaching concerning David and Doeg is brought from “Midrash Tehillim” on chapter 52, subsection 6.
In subsection five, as a preface to the passage from “Midrash Tehillim” quoted by the Chofetz Chaim, we learn that on account of Doeg’s having demonstated his physical strength by murdering eighty-five kohanim and Nov the city of kohanim, David cried out, “Why shall the strong one glorify himself with evil, [for] the kindness of G-d [extends throughout] the entire day?” (Tehillim: 52; 3)
The entire passage from this section of “Midrash Tehillim”, reads as follows:
““Why shall the strong one glorify himself with evil…?” (Tehillim: 52; 3) David said to [Doeg]: ‘You are strong, wealthy, and are the head of the Sanhedrin (Jewish religious High-Court), [and] involve yourself in this [act of] evil and speak Lashon HaRa.’ “…in the evil of the strong one…”: [David said to Doeg], ‘Is it [really an act of] strength for a person to see his fellow [standing] by the opening to a pit, and [then] push him into the pit, [or] is it considered [an act of] strength [to] see him [standing] on the top of the roof and [then] push him [so that he falls to the ground]? Rather, when is [the person truly considered to be] a “גבּוֹר” – “strong person”? [A person is truly considered to be strong] when his fellow is about to fall and he grasps onto his hand so that he won’t fall, the same being true concerning one who sees that his fellow has fallen into the pit and he raises him [out of the pit]. You, [Doeg], have seen Shaul get incensed at me, and you have poured water upon my limbs, is this how a person should behave?’ “…in the evil of the strong one…”: ‘Does someone perform the kindness of G-d in such a manner?’ [David said to Doeg], ‘Do you think that if Achimelech wouldn’t have accepted me and wouldn’t have given me the slice of bread that no one in Israel would have given me [the bread]? [The People of Israel are accustomed to perform kindness at all times to anyone who comes [to them in need of help].’ Another explanation of “…kindness of G-d throughout the day”: David said to Doeg, ‘A person [such as yourself] who is involved with G-d’s kindness the entire day, this being Torah, as it says, “…and The Torah of kindness is upon her tongue.” (Mishlei: 31; 26), will be involved in such things [as speaking Lashon HaRa and wiping out Nov, the city of the kohanim], and thereby make Torah a fraud, “with the evil of the strong one [in Torah]”. Another explanation of “…kindness of G-d throughout the day.”: A person who performs kindness with G-d, it being a difficult matter, seemingly that everyone who is involved in [the study of Torah] is considered as if he has performed kindness with G-d, and you, [who are involved in Torah, nevertheless] involve yourself in Lashon HaRa, “…with evil of the strong one…”. Rabbi Yosi ben Zimra said, come and see how severe Lashon HaRa is. [For] a person has 248 limbs, some of them are straight, some of them are inclined, some of them stand up, and this tongue is placed in the prison, and the cheeks and the teeth surround it. There are a number of mechanisms that are upon [the tongue] and the person is unable to overcome it, if it would be straight, how much more so [would the person be unable to overcome it].” (Apparently, if the tongue would be unfettered and not be surrounded by the cheeks, teeth, and lips, the person would then not even need to open his mouth to speak, and consequently it would be all the more difficult to overcome the urge to speak Lashon HaRa.)