How to beat Ill-Gotten Gains?
Not sure which Dominion expansions are you running, but there are several cards that can counter this.

If you have prosperity, you can add the Watchtower to the kingdom cards which blocks curses gained in this manner, priced at only 3$. With Masquerade from Intrigue, or Ambassador from Seaside you can give those curses back to your opponent. Dark Ages has several cards which work with trashing.

On the other hand, if you put a more valuable 5$ card you can rush that instead of going for IGG. Embargo from Seaside also works wonders.

As the other poster states, if there is no counter focus on going for duchies as well as any other victory cards placed in the kingdom set.

Source: http://dominionstrategy.com/2012/02/06/hinterlands-ill-gotten-gains/