City created numerous chances in a mostly one-sided affair completed in heavy rain but the visitors looked set to hold firm and lift themselves off the bottom of the Barclays Premier League.
But City fought to the end and Barry got on the end of a cross from David Silva to head home to much relief in injury time.
City could only curse their luck as they carved out several opportunities but failed to take them in the first half.
Aguero made another good run to reach the byline but his cross evaded everybody before Javi Garcia planted a firm header straight at Federici.
Silva played a neat one-two with Tevez but shot wide and Aguero then teed up Tevez but Federici saved. The ball rebounded to Tevez but his follow-up was deflected over.
Aguero burst through just before the break but Reading closed down shooting angles and Tevez could not get on the end of his cross.
As the game moved into four minutes of injury time, City launched a final push. Aguero fired into the side-netting but Barry came good as he jumped above the defence to reach Silva's ball and head firmly past Federici.