Imran Ali, who was arrested after her body was found in a garbage dump, was executed in Lahore's Kot Lakhpat prison early on Wednesday, police said.
Zainab's father and other relatives were present.
The case, the most heinous in a string of similar child murders in the city of Kasur, had sparked outrage and protests in the country.
Zainab disappeared on 4 January and her body was found five days later.
On 23 January, after widespread protests complaining of police incompetence, Imran Ali was arrested though a DNA match.
On January 23, the police arrested Imran, a neighbour of Zainab, as his DNA matched not only with the DNA samples collected from the body of Zainab but also at least seven other victims.
He was sentenced to death in February. His appeals against the verdict failed and earlier this month President Arif Alvi rejected a plea for clemency.
(Excerpts from BBC News and tribune.com.pk)