A Yale student who had been suspended by the university was found not guilty on Wednesday of sexually assaulting a fellow student, in a rare college rape accusation to be tried in the courts. The verdict laid bare seemingly gaping divides in the national reckoning around sexual consent and assault.

Over several grueling days on the witness stand in a New Haven courtroom, the woman described what she said was her rape by the accused student, Saifullah Khan, 25, on Halloween night 2015. The testimony, in open court, offered a glimpse into the kinds of encounters that are more often described behind closed doors, to university panels or among friends.

Mr. Khan’s lawyers worked relentlessly to discredit the account of the woman, who was not identified by name in the arrest warrant application. They asked repeatedly how much she had to drink, and how she could claim not to remember certain details, such as how she arrived back at her dorm room, but remembered others, such as the alleged assault itself. They parsed her text messages with Mr. Khan, asking if she had not been flirting with him in the days before the incident. They showed off her Halloween costume, a black cat outfit, and asked her why she had not chosen a more modest one, such as “Cinderella in a long flowing gown.”

Laura Palumbo, a spokeswoman for the National Sexual Violence Resource Center, called the defense’s line of questioning “all victims’ worst fears in coming forward.”