The France defender scored the winning goal with six minutes remaining to keep Madrid in the hunt for the title race.
Before the match on Friday, Madrid boss Zinedine Zidane blasted reporters and demanded more respect for the reigning champions who earned an important victory.
Huesca took a shock lead just after the break through Javi Galan but Varane's brace helped Madrid comeback and close the gap on leaders Atletico Madrid.
"It was very important to win today. We know the difficulties lately," Zidane said postmatch. "It's a good victory for us. Three points. We played a game with character."
He added: "The start of the game, it's true, in this situation we weren't comfortable, we started OK but after 20 minutes we got into the game well. We had to win. It's little by little.
"We have to get back to playing good football, playing with joy as Real Madrid do. We have to be patient, today we can be happy with what we did."
Real went into the game smarting from last week's shock home defeat by Levante plus a double injury blow as Eden Hazard suffered yet another setback by tearing a thigh muscle and Sergio Ramos had surgery to treat a knee problem.
They were missing seven first team players and had to call upon reserves to fill the bench while throwing on inexperienced 20-year-old midfielder Marvin Park in the second half.
Huesca, who have only won two league games all season, gave Real two early scares as Shinji Okazaki and Mir came close to scoring and they were even more determined in the second half, with Mikel Rico's chip hitting the bar just before Galan struck.
Mir was unlucky not to double their lead when his volley came off the bar and he almost restored Huesca's advantage after Varane's leveller, forcing goalkeeper Thibaut Courtois to leap to the top left corner to push his header away.
Benzema then wasted a glorious chance to give Real the lead when the ball fell to him at point-blank range, but the usually clinical forward fired straight at keeper Alvaro Fernandez.
Instead, it was another Frenchman in Varane who got the winner, reacting quickly to turn in Casemiro's header and temporarily ease the pressure on compatriot Zidane.
"Your character really shines through when the going gets tough," Varane added. "We're a strong team and we always fight for each other and we'll keep doing that until the end of the season."
Information from Reuters was included in this report.