Although Science, Technology, Engineering, and Mathematics (STEM) are essential for the development of society, men hugely outnumber women in the majority of STEM fields in higher education, a factor that hinders inclusion and restricts the possibility of having different points-of-view. Previous studies indicate multiple causes of low female motivation in STEM degrees and careers, which inspired several initiatives to increase female interest in STEM. A proven way to captivate an audience to change its attitude is the heroic narrative model, a style of narrative in which a character goes through a sequence of difficultyincreasing and attitude-shaping quests. This paper proposes a heroic narrative model named Heroine's Learning Journey (HLJ) targeted at counteracting low female participation in STEM courses. In particular, the HLJ model is developed especially for enhancing STEM online courses, by using a narrative that can encourage female students to engage and prevail in them. The HLJ model is divided into three acts, each composed of several stages symbolizing steps tailored to a female student's development. The model was applied to set up the structure of a preexisting Machine Learning online course with hundreds of enrolled students. Although a first version of the course already presented a higher-than-expected female enrollment per se (≈ 37.3%), with HLJ, we verified an even higher female enrollment (≈ 59.2%), slightly surpassing male enrollments. The feedback provided in learners' responses to a final, voluntary and anonymous questionnaire, allowed to obtain the degree of satisfaction of participants at the end of the course with the HLJ. The responses indicated that, at the end of the second edition of the online course, students were able to acknowledge the existence of a STEM gender imbalance, and appreciated the motivating nature of the HLJ model. From several student's feedback and comments submitted in the questionnaire, one can conclude that the attitude-shaping character of the HLJ was greatly appreciated, in addition to the technical content of the course. All these preliminary results are indicative of the usability of HLJ to foster gender balance in STEM online courses. Thus, the present study contributes to STEM Education by leveraging the motivation of young women to enter and prevail in these areas of study.