Celsa Aleman says she and her 7-year-old niece were riding a donkey along a road when the lion went after the donkey's legs.
The 35-year-old woman says she found the courage to fight the lion because she thought it would attack her niece.
She hit the animal with a machete until the beast ran away.
Aleman and her niece were unharmed.
The state government says the lion had escaped from a private zoo.
It killed two dogs and ate a pig before it was sedated and taken back to the zoo.