This is the eighth such discovery in recent months.
Officials believe the bodies are being dumped in the city’s rivers as a result of abortions, which are illegal in most cases in Kenya.
Nairobi Governor Mike Sonko has called for an investigation into what he called a “worrying trend”.
Several workers were cleaning up the badly polluted Nairobi River that flows through Korogocho, one of the city’s biggest slums, when they made the grim discovery.
Kenya country profile
They found the babies’ bodies in a plastic bag. One was still breathing but could not be saved.
The babies were buried near where they were discovered after the police said the parents could not be identified, governor’s spokesperson Elkana Jacob told the BBC’s Focus on Africa programme.
Governor Sonko believes that hospitals and clinics are dumping the bodies after performing abortions.
He has given his officials a week to investigate the issue.
As well as eight babies, four dead adults have also been found during the exercise to clean up the city’s rivers.