The Bodak Yellow and I Like It rapper told jurors that when she stepped out of an elevator, Ms Ellis, who was working as a security guard in the building, told someone on the phone that she was there, then followed her down a hallway.
The performer, whose real name is Belcalis Marlenis Almánzar, added that Ms Ellis appeared to record her on her phone, invaded her privacy and refused to "back up", before a face-to-face "verbal altercation" ensued.
She admitted shouting an obscenity at Ms Ellis while telling her to "get out of my face", adding: "We're literally screaming at each other."
Her lawyer noted how the star had "feared for her unborn baby" and also accused Ms Ellis of having "changed your story".
Ms Ellis earlier told the court she said the rapper's name out of excitement when she saw her, but didn't tell anyone she was there and didn't film her.
Ms Ellis claims the rapper accused her of trying to spread news about her being at the doctor's office, then hurled insults and threats, and attacked her.
A plastic surgeon testified that he had treated Ms Ellis for a "hyper-sensitive" scar on her cheek, "most likely" caused by fingernails, after first examining her in 2022.
Ms Ellis sued the star in 2020 for assault, battery and intentional infliction of emotional distress as well as negligence and false imprisonment.