Generally yes – It’s illegal for an outsider to enter anyone’s home and plant a concealed recording device without a warrant or court order. At the very least it would be considered trespassing, and beyond that it can be seen as a violation of protections in the Civil Rights Act, punishable under federal law.
Your question as posted really lacks enough facts and specifics to determine whether there are any circumstances beyond personal suspicion or assumptions that could justify doing what you suggest. Rape and sexual abuse are serious crimes, but so is invading someone’s home without verifiable good cause.