The former world number one dropped the opening set before prevailing 3-6 6-3 6-4 over the Brazilian.
Federer got off to a sluggish start against Bellucci and admitted he was feeling the effects of another three-setter against Milos Raonic.
"I really struggled to make the transition [from yesterday's match]," he told www.atptour.com.
"I was quite surprised, but at the end I found a way, dug deep and came through.
"It's really important. At the end of the day, these are the wins that sort of almost feel better, to be quite honest, because when you're playing great, it's simple, and it's easy."
Next up for Federer is Juan Martin del Potro who beat Denis Istomin in three sets.
There were no struggles for second seed Rafael Nadal who beat Alexandr Dolgopolov 6-3 6-2 to set up a quarter-final with David Nalbandian, who upset sixth seed Jo-Wilfried Tsonga 3-6 7-5 6-3.
The other quarter-final will be between John Isner and Gilles Simon, who beat Matthew Ebden and Ryan Harrison respectively.