Malcom's second-half goal cancelled out a sixth-minute opener from Lucas Vazquez and ensured there will be plenty to play for in the return fixture on February 27.
With Lionel Messi fit enough only for a place on the bench, the onus was on Barca to show it could cope without its talisman in the first of a difficult run of fixtures this month.
Madrid went ahead with the second shot of the match, though, Vazquez twisting his body to flick the ball beyond Marc-Andre ter Stegen from Karim Benzema's drilled cross.
Malcom, starting in the cup for the fifth time this season, scuffed a glorious chance straight at Keylor Navas but was spared somewhat by the offside flag.
The Brazilian was proving a problem down the Madrid left and it was his free-kick that Ivan Rakitic headed against the crossbar, before Vinicius Junior almost set up Benzema for a tap-in on the break.
Luis Suarez saw a shot well saved by Navas after more good Malcom work, but frustrations began to build for the home side in its struggle to create clear-cut openings.
Barca found the equaliser 57 minutes in, however, when Sergio Ramos, having brilliantly cleared a Suarez effort off the line, allowed Malcom's strike on the rebound to fly past him and into the net, apparently convinced it was going wide.
Messi and Gareth Bale were introduced from the bench, and it was the Madrid man who missed the best chance for a winner, failing to make the most of Benzema's pass after Ter Stegen had been left stranded.