Nicolai Mueller was twice on target for Mainz while Vedad Ibisevic and Martin Harnik replied for the visitors.
Japan forward Okazaki, one of four Mainz debutants, left Stuttgart six weeks ago to join Mainz as a replacement for last season's leading scorer Adam Szalai who moved to Schalke 04.
Mueller opening the scoring in the 14th minute but Ibisevic levelled two minutes later. There was a suspicion of offside when Okazaki put Mainz back in front in the 65th minute before Mueller added another goal in the 78th minute.
Harnik pulled one back with eight minutes left.