Harit's late strike moves Schalke level with leaders Leipzig
Schalke have 10 points having played a game more than Leipzig, who travel to Werder Bremen on Saturday, and are two ahead of champions Bayern Munich before their home match with Cologne thanks to Harit's last gasp solo effort.
The Moroccan international won the match for the hosts when he collected the ball and darted towards goal before curling home a spectacular winner with the outside of his boot into the bottom corner.
Harit was also the architect of Schalke's opener, playing a perfect pass into Suat Serdar's path before the German smashed home in the 36th minute.
The defeat was tough on Mainz, who remain third-from-bottom despite Karim Onisiwo grabbing the away side a deserved leveller 14 minutes before Harit snatched the three points.
Mainz are in the relegation play-off place after losing for the fourth time in five matches.