Spain were leading with Alvaro Morata's goal until the 82nd minute and were almost at the cusp of their second win in the tournament before Niclas Fullkrug turned up to score for Germany, helping the four-time champions avoid the embarrassment of consecutive losses.
Hungary remained second above Germany in UEFA Nations League Group A3 after Zsolt Nagy and Jonas Hofmann struck early in an absorbing draw in Budapest.