Mainz maintain perfect start
Croatian striker Srdjan Lakic scored his fourth goal of the season to put the visitors into the lead after 20 minutes, picking up a deep ball to race clear and flick in from the edge of the box.
A lapse of concentration by dominant Kaiserslautern midway through the second half allowed Mainz to battle back and equalise through Niko Bungert in the 71st minute from close range before Andre Schuerrle's slightly deflected shot two minutes later handed them the three points.
"We started very badly but I am delighted to have turned it around with a double strike," Mainz coach Thomas Tuchel told reporters.
"Patience, patience, patience. That is what I always tell my players. At the end our patience paid off."
Kaiserslautern, who had won both of their previous matches, dropped to fifth place on six points.
In the only other match on Sunday, Cologne got their first points, edging past St Pauli 1-0 with Taner Yalcin volleying in the rebound after Lukas Podolski had rattled the post with a fierce left-footed drive from 20 metres.
Champions Bayern Munich stuttered to a 0-0 draw against Werder Bremen on Saturday to remain in 11th place on four points.
Mainz have nine points, the same as Hoffenheim who gave Champions League participants Schalke 04, last season's runners-up, their third successive defeat on Friday.