The loss was only the second this year for Federer, who owns 2017 titles at the Australian Open, Indian Wells and Miami.
The 18-time grand slam winner last played on April 2, when he won Miami; he then skipped the entire clay season to prepare for the grass and Wimbledon.
Haas produced only his fourth win in 17 matches against his longtime friend, in a series which began in 2000.
'I'm mainly speechless of course,' Haas said.
'Playing Roger is very special - especially on grass and also in Germany.'