When the victim of rape unconsciously killed the rapist for instance as a self defence.
However a victim of rape that performed murder in a justifiable way will still be considered as a criminal (if proven guilty) in a different crime scene with a proven case of homicide.
A homicide may be considered justified if it is done to prevent a very serious crime, such as rape, armed robbery, manslaughter or murder. If you kill another person, you are committing a homicide. The level of the homicide is legally defined as murder if the act was intentional and as manslaughter if it was unintentional.