The Liverpool defender and Netherlands U21 international returns to the German top flight for 2023-24 having spent the last campaign with Schalke 04.
Van den Berg, who arrived at the Reds in the summer of 2019, had previously enjoyed 18 months on loan with Preston North End in the Championship.
Mainz finished ninth in the Bundesliga last term and are set to begin their new season with a trip to Elversberg in the DFB-Pokal on August 12.