A 44th minute goal from midfielder Claudia Zornoza -- after Nahikari Garcia had an earlier strike ruled out for offside -- was enough to see them progress from the competition's second round of qualifying with 2-1 victory on aggregate.
The teams had drawn 1-1 in the first leg at Madrid's Alfredo di Stefano stadium on Aug. 31, when defender Kenti Robles scored a dramatic added time equaliser for the hosts.
The result was an upset, with City having made the Champions League quarterfinals last season, while Madrid are competing in Europe for the first time.
Real Madrid Femenino were only officially formed in the summer of 2020, after the Spanish giants acquired the Madrid-based women's team C.D. Tacon in 2019.
They finished second in Spain's First Division last season -- 15 points behind champions Barcelona -- to qualify for the Champions League second round.
The Champions League draw will take place on Monday Sept. 13 in Nyon, when holders Barcelona, Madrid and 14 other teams will be divided into four groups of four for the group stage.