LONDON, June 5 (Reuters) - Healthy gains in tech stocks lifted emerging market equities to a three-week high on Tuesday while Mexico's peso took a beating amid concerns that trade tensions with the United States could escalate.

MSCI's emerging market benchmark rose 0.2 percent in its fourth straight day of gains with emerging tech stocks advancing 0.3 percent, taking their cue from the Nasdaq closing at record highs.

Following four months in the red, the recent days' gains brought the index closer to where it started the year.

Figures from the Institute of International Finance published on Tuesday showed a heavy sell-off in emerging markets saw foreigners dump a combined $12.3 billion of bonds and stocks in May.

"Spring 2018 has presented a 'stress test' for emerging markets with a combination of higher U.S. interest rates, a rally in the dollar, and rising oil prices," Goldman Sachs' Andrew Tilton said in a note to clients.

"We still see emerging market equities as the best-placed asset class for the kind of 'firm growth, rates up' macro environment that we are likely to be in for the foreseeable future."

On the day, China mainland stocks rose as much as 1 percent , underpinned by data showing the country's services sector expanded at a steady clip in May.

The Caixin/Markit services purchasing managers' index (PMI) showed companies accelerated hiring on the back of the strongest optimism for future growth in 11 months, soothing investors' nerves over the health of the world's second largest economy. However, firms also reported slower growth in new orders.

Emerging currencies painted a more sombre picture.

Mexico's peso weakened 0.7 percent against the dollar to its lowest since February 2017 after industry officials said the country will impose a 20 percent tariff on U.S. pork imports as part of retaliatory measures against President Donald Trump's tariffs on steel and aluminum.

That U.S. decision has complicated talks with Mexico and Canada to rework the North America Free Trade Agreement (NAFTA).

"Having been one of the victims of Trump's steel tariffs last week it looks as though Mexican officials have given up on the idea of any progress on NAFTA and instead are considering retaliatory tariffs," wrote Chris Turner, head of FX strategy at ING, in a note, adding that could fan fears that Trump may pull out of the agreement.

Turkey's lira weakened 0.6 percent against the dollar as investors geared up for a key central bank meeting on Thursday. Data on Monday showed inflation rose faster than expected in May, increasing expectations that policymakers may have to hike interest rates again to stem declines in the local currency.