Second half strikes from Lisandro Martinez and Klaas-Jan Huntelaar sealed victory for Erik ten Hag's men against the visitors who were reduced to 10 men.
Ajax were dominant but impressive goalkeeping from Sergio Padt ensured that the first half ended 0-0.
In the 18th minute, Ziyech had a chance to put the Lancers ahead but his shot was saved by goalkeeper Padt. Another chance beckoned eight minutes later, but he missed target.
Groningen were reduced to 10 men in the 73rd minute after Django Warmerdam was sent off for a second caution.
That seemed to be the tonic Hag's side needed as they took the lead three minutes later through Martinez from Ziyech's assist, while Huntelaar sealed victory with his 79th minute effort.
Onana made crucial saves to prevent Danny Buijs' men from scoring and in summary, he made two saves, 26 passes and 34 touches.
Morocco's Ahmed El Messaoudi was on parade for the entire duration for Trots van het Noorden with his compatriot Mohamed El Hankouri replacing Sergino Dest after 67 minutes.
Leaders Ajax travel to Estadio de Mestalla for Wednesday's Champions League clash with Valencia.