A sellout crowd sang Happy Birthday to the second seed early in the second set, and cheered post-match as the 17-time grand slam winner was presented with an oversized chocolate cake to mark the occasion.
Federer remains a perfect 4-0 on matches played on his birthday.
"At 33 it's a dream to be playing tennis at this level," said Federer, who lost his first set to Ferrer since 2010 as the Spanish fifth seed took the match into a deciding third set after losing ten previous sets in a row against the Swiss.
"I really enjoyed the match, it's always a challenge against David," he said.
"My goals now are to stay injury-free and try and go out on my terms.
"I have two titles this year and I hope to win more, it all starts again tomorrow on the court."
Federer will face his next test against another Spaniard when he takes on Feliciano Lopez, a winner over Canadian sixth seed and 2013 finalist Milos Raonic 6-4, 6-7 (5/7), 6-3.
The Basel native boasts an unblemished 10-0 record in that series, which began 11 years ago.