Wisdom 11:5

5 For by what things their enemies were punished, by the same they in their need were benefited.

Wisdom 11:5 In-Context

3 They stood against their enemies, and were avenged of their adversaries.
4 When they were thirsty, they called upon thee, and water was given them out of the flinty rock, and their thirst was quenched out of the hard stone.
5 For by what things their enemies were punished, by the same they in their need were benefited.
6 For instead of a fountain of a perpetual running river troubled with foul blood,
7 For a manifest reproof of that commandment, whereby the infants were slain, thou gavest unto them abundance of water by a means which they hoped not for:

The Brenton translation of the Septuagint is in the public domain.