The victory gave Eintracht boss Niko Kovac his first trophy as a coach in his final match before leaving to take over from Heynckes at Bayern.
After Rebic's opening goal, Robert Lewandowski equalised for Munich early in the second half. However, Rebic added his late second before substitute Mijat Gacinovic tapped into an empty net just before the whistle to delight Frankfurt fans and break Bayern's hearts.
“Everyone said that we'd be beaten out of the stadium,” said Frankfurt's Ghana midfielder Kevin-Prince Boateng. “But we showed heart and it was Bayern who were beaten.”
This was supposed to be Heynckes' farewell party with Bayern sending their 73-year-old head coach into retirement with the German cup and league double having wrapped up a sixth straight Bundesliga title.
“It was an avoidable defeat and sometimes defeat belongs to sport,” said Heynckes graciously. “We made a serious mistake before they went 1-0 up. If you don't exploit your chances, then you can't win a cup match like that.”
It is exactly 30 years since Eintracht last won the German Cup as they lifted the trophy for the fifth time.
“I am happy that we have won the cup after 30 years,” said Rebic. “The team deserves it, Bayern are always the favourites, but at the end it was us who won the cup.”