Chancellor Angela Merkel's conservative CDU reached the agreement in talks with its centre-left coalition allies the SPD, without saying when the changes would take effect.
Under the deal, companies with more than 200 employees will have to be transparent about what they pay men and women in equal positions and publish wage data in anonymous form.
Companies with more than 500 staff will have to introduce mechanisms to equalise pay for both sexes, said SPD parliamentary chief Thomas Oppermann.
He hailed the proposed law as “a great step forward” for millions of female employees.
Women in Germany earn around one fifth less than men, according to official data released in May.
In raw or unadjusted terms, the gender pay gap stood at 21 percent in Germany last year, above the European average of 16.5 percent, the federal statistics office Destatis calculated.
In the former communist east of the country, the pay gap was much narrower, standing at eight percent last year, but in the west it stood at 23 percent, Destatis calculated.
Women in Germany tend more often to work in low-paid jobs or sectors and frequently only part time, the statisticians said.
The adjusted pay gap, which compares wages for people with the same qualifications doing the same work, stood at seven percent.