With just 947 points separating Sabalenka and Rybakina in the world rankings prior to the start of the grass-court Grand Slam, 27-year-old Rybakina had to reach at least the quarter-finals to stand any chance of challenging for top spot.
After her triumph in Melbourne at the start of the year, Rybakina slumped to a second-round exit on the French Open clay in May before early defeats on the grass of Queen's and Berlin followed in the lead up to Wimbledon.
She was taken to a deciding set by France's Lois Boisson in her opening match but faced no such issues against American Caty McNally in the second round, dropping just three games on her way to a comprehensive victory.
But Mertens proved her undoing, and after a tight opening set went in the Belgian's favour on the tie-break, Rybakina failed to recover.
Mertens won nine points in succession in a dominant second set before defying late jitters on serve - which led to two wasted match points - to clinch victory with an ace.
For Mertens, a fourth-round meeting with Marie Bouzkova awaits after the Czech 21st seed came from behind to defeat Liudmila Samsonova in three sets.
"I have no words, actually. I'm very happy I won that first set and kept the momentum going," said the 30-year-old, a two-time women's doubles champion at SW19.
"This is definitely one of the biggest wins of my career, especially here at Wimbledon. I've had some success here before. I'm just very pleased with my performance today."