The first grader was accompanied by a 17-year-old boy when a gunman opened fire on them in the Elsies River suburb around 1110 IST. Both were wounded.
"The boy was on his way to school when shots were fired," police spokesman Andrew Traut said.
A 27-year-old man has been arrested in connection with the shooting and will appear in court tomorrow on attempted murder charges.
The populous and poverty-stricken eastern outskirts of Cape Town, known as the Cape Flats, are notorious for shootouts between gangs, with school children regularly caught in the crossfire. Last year, sixteen schools were shut for two days as violence flared in the area.
Between 2007 and 2011, 532 murders took place in five gang hotspots in Cape Town, according to police statistics.
The provincial government has repeatedly demanded that the army should be sent in to the restive area, but the calls have been dismissed by the national government.