Foreign Minister Luis Videgaray said such a tax would make Mexican imports more expensive for US consumers and they would end up paying for the wall.
The Mexican president earlier cancelled a visit to the US over the row of who would pay for the barrier.
The planned wall was one of Mr Trump’s key election campaign pledges.
Earlier this week, the president signed an executive order to create a wall along the 2,000-mile (3,200km) US-Mexico border.
Speaking on Thursday, Mr Videgaray said: “A tax on Mexican imports to the United States is not a way to make Mexico pay for the wall, but to a way make the North American consumer pay for it through more expensive avocados, washing machines, televisions.”
He also stressed that paying for Mr Trump’s wall “is not negotiable” for Mexico.
Earlier on Thursday, White House spokesman Sean Spicer said a 20% tax could generate approximately $10bn (£8bn) in tax revenue per year.
“Right now our country’s policy is to tax exports and let imports flow freely in, which is ridiculous”, he said, adding that the tax will “easily pay for the wall”.
But Reince Priebus, the White House chief of staff, later said that the border tax is only one of several options being considered