It was the first league defeat of 2022 for Leverkusen and halted their four-game winning streak. They also lost the chance to make up ground on second-placed Borussia Dortmund.
The loss leaves them third in the standings on 41 points, five behind Borussia Dortmund and 11 behind leaders Bayern Munich, having played a game more than both.
Mainz meanwhile climbed to seventh on 34 points, level with fourth-placed RB Leipzig plus Hoffenheim and Freiburg in the battle for the final Champions League berth.
Leverkusen went into the fixture in insatiable form, having scored 16 goals in their last four matches including a 5-2 win at Borussia Dortmund and a 4-2 win over VfB Stuttgart in their last two outings.
They got off to a strong start when Czech Republic striker Patrik Schick scored against the run of play with a deflected effort 10 minutes before halftime, notching his 20th goal this season in 20 games, with only Bayern Munich's Robert Lewandowski scoring more.
Schick was forced off injured early in the first half, however, to be replaced by Argentine striker Lucas Alario, who restored Leverkusen's lead in the 74th minute after Aaron Martin had levelled for the hosts with a free kick in the 58th.
Mainz made a triple change with eight minutes remaining and were promptly rewarded when Dutch midfielder Boetius equalised with a strike from the edge of the area in the 84th.
Danish forward Ingvartsen completed the comeback in the 88th, pouncing on a loose ball in the area to squeeze a shot under Lukas Hradecky.