Phrase that means "gaining money for someone" in a negative context

Solution 1:

There are several idiomatic phrases in English that have to do with activities that result in another's financial gain, such as

line someones pockets

and

feather one's own nest

but those are more often used to describe a self serving activity, one's own gain.

The phrase is often used to describe working at the direction of, and for the benefit of, another but does not have specific financial implications, and reflects a direct, rather than a collateral benefit.

The closest I can think of is play into his hands

to assist one in one's scheming without realizing it

This generally reflects a battle of wills and may or may not concern financial matters.

Solution 2:

The phrase "working for the man" has some of this flavor to it, and there are various quotes from the song "Sixteen Tons" that show up sometimes:

You load Sixteen Tons, and what do you get?
Another day older, and deeper in debt.
St. Peter don't you call me, cause I can't go,
I owe my soul to the company store.

The most common phrase in English in this space has things turned around, however; the third party is earning money "on the backs of" the other people.