Emma Hayes' side looked to be facing the awkward prospect of requiring a result next week away at Paris FC when Real substitute Athenea del Castillo tapped in on the rebound, reacting quickest after goalkeeper Hannah Hampson had beaten out Hayley Raso's effort with 20 minutes to play.
A penalty earlier in the second half from Guro Reiten had seemingly put Chelsea en route to the win they required.
But after the visitors had hit back it fell to Erin Cuthbert, wearing the armband with Millie Bright still absent, to lead by example, sending over a cross that bounced in off the unfortunate Real goalkeeper.
Chelsea's first chance fell to the left foot of Cuthbert, drilled low against the legs of Chavas after Fran Kirby had found her with a deft through ball.
Jess Carter drilled a searching pass to the left flank that was helped on by Niamh Charles, rampaging forward from full-back, into the path of Reiten. She hit an audacious, dipping effort that was just clawed out from underneath the crossbar.
Real threatened through Colombia international Linda Caicedo, tricking her way in behind Kadeisha Buchanan and looking to poke it beyond Hampton from a devilish angle. The goalkeeper, making her Champions League debut, instinctively threw up a strong right hand and beat the ball away.
Reiten set up Cuthbert, who swung and missed her kick with the goal gaping, before the Scotland international and stand-in captain crossed to the near post to present Mia Fishel with seemingly an easy finish, but she could only guide it wide.
Hayes sent on Lauren James, fresh from her weekend hat-trick, at the break as her side searched for the goal that would seal a last-eight berth, whilst the precocious 18-year-old Caicedo, injured during the first half, was withdrawn by Real boss Alberto Toril.
Anything less than a win and qualification for Chelsea would go to the final matchday, a result likely needed away at impressive Champions League debutants Paris, twice conquerors of Real in this season's competition.
The goal to radically alter that equation arrived just past the hour. Melanie Leupolz's pass split Real's defence and ran through to Cuthbert, arch-tormentor of her opposite number Kenti Robles.
The full-back's challenge was a mess, scything Cuthbert to the ground. From the spot, Reiten put one Chelsea foot in the quarter-finals.
James looked to seal it with a goal all of her own making, cutting in from the right and standing up two defenders before racing beyond them and clipping a shot towards the near post that was brilliantly deflected away by Chavas.
Then all of a sudden, Chelsea switched off. There seemed little on for Real when the ball was pinged up to Raso, high up on the right of the box but with Charles in her path and only Athenea to aim for.
Instead she looked to do it herself, blasting low at goal, her shot beaten out by Hampson but into the path of the substitute who tapped home.
Fortune smiled on Hayes' team almost at once, their lead restored within a minute when Chavas lost concentration at the critical moment and fumbled Cuthbert's cross over her own line.