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.
After he was sentenced to death for raping and murdering Zainab, Imran Ali was convicted for similar crimes against six more girls.
Zainab's father, Amin Ansari, said after the execution that he was "satisfied".
"I have seen his awe-inspiring end with my own eyes," he told reporters.
However Mr Ansari, who said that Zainab would have been seven years and two months old if she was alive, expressed regret that authorities did not televise the hanging.
Mr Ansari's earlier appeal for Ali to face a public hanging was dismissed by the Lahore High court.
Zainab disappeared on 4 January and her body was found five days later in a rubbish dump.
Police said there had been several similar child murders in the past two years in Kasur but her killing proved to be a tipping point.
It triggered widespread outrage, including protests complaining of police incompetence. Two people were killed in clashes.
Zainab's family said the police did not take action during the five days from when she was reported missing until her body was found.
Relatives, not police, recovered CCTV footage of her last movements.
The footage, which showed a girl being led away by a man, was circulated widely on social media. The hashtag #JusticeForZainab later went viral, with many Pakistanis calling for action.
On 23 January, 24-year-old Imran Ali was arrested though a DNA match.
He was sentenced to death in February for Zainab's rape and murder. His appeals against the verdict failed and earlier this month President Arif Alvi rejected a plea for clemency.
More about: Pakistan