Schalke recovered from two goals down to secure a 4-2 victory and inflict a first defeat of the season on Mainz.
It all looked wrapped up for the home side in the first half at the Mainz Arena, with goals from Andreas Ivanschitz and Elkin Soto putting them within reach of a third straight win.
However, Schalke were transformed in the second half with goals from Klaas-Jan Huntelaar, Benedikt Howedes, Joel Matip and Christian Fuchs earning Ralf Rangnick's side a win that seemed impossible at half-time.
"Even if it sounds stupid, we only started playing well after we did nothing in the first half an hour," said Schalke coach Ralf Rangnick. "We were unemotional and lethargic, but the team produced a reaction and were rewarded for it."
Mainz were aiming to maintain their 100 per cent record and, after 12 minutes, they were on course to do just that. Ivanschitz put them ahead in the seventh minute when he met Zoltan Stieber's free-kick unchallenged with a precise volley to beat Ralf Fahrmann.
Five minutes later, ex-Mainz midfielder Lewis Holtby did his former team-mates a favour by losing possession to Karim Allagui, whose long-range shot caught Fahrmann off guard. The Schalke goalkeeper fumbled the ball at the feet of Soto, who doubled Mainz's lead.
The home side threatened to run away with the game and Ivanschitz almost added a third after a quarter of an hour.
Schalke were simply not permitted a route into the game as the Mainz players doubled-up to put the pressure. The pressing worked as Schalke's game failed to take off and the hosts looked comfortable, until Jefferson Farfan entered for the first time this season at the start of the second half.
Schalke were transformed and they reduced the arrears in the 57th minute through Huntelaar's fourth goal of the season from Raul's assist. Howedes then levelled in the 64th minute when he headed Farfan's cross in at the far post.
Mainz tried to respond, but Eric-Maxim Choupo-Moting saw a goal ruled out for offside after he poked in the rebound when Eugen Polanski's shot bounced back off the post.
And the next goal came at the other end with Matip diverting Raul's header into the back of the net in the 81st minute. Fuchs completed the remarkable turnaround in the last minute with Schalke's fourth, a direct free-kick from almost 25 yards which left Heinz Muller no chance.
In today's other game, Hanover 96 went second in the table behind surprise early leaders Borussia Moenchengladbach after being held 1-1 at home by Hertha Berlin. A free-kick from midfielder Sergio Pinto on 33 minutes put Hanover ahead before Berlin teenager Pierre-Michel Lasogga equalised in the 83rd minute. Hanover were refused a late winner after defender Christian Pander drilled a long-range free-kick flew into the Hertha net, but referee Robert Hartmann ruled the goal out for offside.