Eighth seed Mertens came back from a break down in the deciding set to beat Alize Cornet 3-6 6-2 6-4.
Mertens, who had not beaten Cornet since 2018, will face either Petra Martic or Kamilla Rakhimova in the next round as she bids to reach her first quarter-final of 2022.
"It was a very tight match," Mertens said. "It could go either way, it was a battle. It's always difficult against her but I just kept fighting.
"I think I raised my level a little bit in the second and third sets. I stepped more into the court, the service was a bit better and I ran better."
Second seed Kontaveit needed three sets to get past Jil Teichmann, ultimately prevailing 6-3 1-6 6-3, while number five seed Belinda Bencic squeezed past Veronika Kudermetova 6-2 4-6 7-6 (7-5).
In Tuesday's other game, Ekaterina Alexandrova defeated Camila Giorgi 6-2 1-6 6-2.