Ramos' chipped penalty gave Madrid a 2-1 half-time lead at the Santiago Bernabeu after Lucas Vazquez had cancelled out Anthony Lozano's early strike.
Girona, however, came again, Alex Granell scoring from the spot, only for Ramos to head home with 13 minutes left before Benzema added a fourth to extend the advantage ahead of next week's second leg.
Ramos now has nine goals in all competitions this season and these two were key as Madrid maintained what it is beginning to look like a second revival under coach Santiago Solari.
After a blistering start, Solari oversaw a dip at the turn of the year but his team have now won four out of their last five, the only slip coming in a second leg defeat to Leganes when progress was already all-but secured.
Real's Solari calls for clarity on VAR
"Football never lets up, now comes Espanyol on Sunday and we want to win to get closer to the top," Solari said. "When hard work is rewarded by results, the feeling is contagious."
It would be a timely run into form, with Atletico Madrid in La Liga and then Ajax in the Champions League both to come at the start of next month.
Ten points adrift in the league, this competition now represents Madrid's best hope of a domestic trophy this season and Solari's selection seemed to suggest as much.
He picked a strong line-up, which included a recall for the struggling Marcelo while Toni Kroos made the bench, after recovering from injury.
Girona were keener to rotate as Cristhian Stuani, La Liga's third top scorer, was left on the bench ahead of Sunday's game at home to Barcelona.
"We prioritise La Liga," Girona coach Eusebio said. "We value the history of the cup but our resources have to be saved for the league."
Madrid were the better side for most of the first half but gave Girona a head-start. Raul Garcia tore away down the left and his cross to the back post found the unmarked Lozano, who could not miss. Marcelo was two yards behind him.
Real Madrid beat Man Utd to the top of 'money league'
Benzema has been the unsung hero of Madrid's stuttering season and it was his pass that led to the equaliser. Odriozola sped away and pulled back for Vazquez to score.
Girona were on the backfoot. Benzema fired over, Alvaro Odriozola overran with only the keeper to beat and Luka Modric wanted a penalty after Douglas Luiz robbed him of the ball from behind.
Moments later, Vinicius was clipped by Lozano and this time there was no doubt. Ramos chipped the ball down the middle.
Benzema grazed the post from distance and Madrid were so dominant it looked like they might take the tie away from Girona in the second half.
Instead, in the 67th minute, Marcos Llorente, on as a substitute, threw his arm towards the ball at a corner and Alex Granell swept the penalty into the top corner to pull Girona level.
Solari turned to Isco, his last attacking option on the bench but Madrid's third came from their central defender, the assist from their left back.
Marcelo swung in the cross and Ramos climbed high above Marc Muniesa to head home.
Girona were on the ropes and Madrid came again. It was almost a mirror image, this time Vinicius curling a sumptuous ball to the back post where Benzema was left with an open net to tap in a fourth.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ