Real boss Zidane had demanded “respect” from journalists before Saturday’s game, claiming his side were still in the La Liga title race.
But Javi Galan fired Huesca into a shock lead before Varane equalised for the reigning champions.
France defender Varane then tapped home a late winner for the visitors.
Real, who are second in the Spanish top-flight table, trail city rivals Atletico Madrid by seven points having played two games more.
Zidane’s side had won just one of their previous five matches and the poor run has led to media scrutiny over the French manager’s position at the club.
Despite victory, his side’s latest performance will have done little to boost Zidane.
Huesca, who had won just two of their previous 21 league games this season, took the lead when Galan was set up by Shinji Okozaki.
It was nearly 2-0 moments later but Rafa Mir, who is on loan from Wolverhampton Wanderers, volleyed against the bar.
Real equalised when Karim Benzema’s free-kick came back off the bar and centre-back Varane headed the rebound over the line.
Varane was then in the right place to tap home the winner after keeper Alvaro Fernandez palmed Casemiro’s header into his path.