The Saint-Etienne forward struck in each half, while Hamza Mathlouthi and Seifeddine Jaziri were also on target as the Eagles of Carthage secured their first points in Group F.
After defeat in their opener against Mali, Tunisia was aiming to avoid losing four successive Africa Cup of Nations matches for the first time in its history.
However, it made the perfect start; striking twice inside the opening 10 minutes at Stade Municipal de Limbe. First, Mathlouthi drilled in his first international goal, while Khazri slotted home soon after.
Any faint hopes Mauritania had of getting back into the game were dashed in the 64th minute, when Khazri brilliantly dummied Ali Maaloul's ball before finishing the return pass from Ghaylene Chaalali.
He then turned provider two minutes later with a perfectly timed throughball for Jaziri to neatly finish.
Youssef Msakni squandered the chance to make it five in the dying moments. His penalty came back off the post, meaning Tunisia have now missed their last three spot-kicks in the competition.