It was claimed that he was held down and stripped during a so-called game of ‘dirty dare’.
Details emerged as the boy’s mother began a legal challenge against authorities at the secondary school.
She is seeking a judicial review over an alleged failure to convene a meeting of its board of governors to carry out a full review and examine welfare issues.
Neither the child at the centre of the case, whose age was not revealed in court, nor the school can be identified.
Apprentice Boys of Derry: new era of respect makes for enjoyable ‘Relief’ parade
Thousands expected to take part in 'Derry Day' this weekend
Feile organisers asked if they have warned Wolfe Tones about leading young people in pro-IRA chants
DUP MP calls for probe into Sinn Fein MP’s Twitter post
Brexit: There’s a fundamental con trick being played over Liz Truss’ Northern Ireland Protocol Bill says Lord Empey
He was said to have gone on a trip with classmates to a location in Co Down last October.
During an overnight stay some of the pupils took part in games in a dormitory, the court heard.
Counsel for the boy’s mother claimed: “Part of that was what was known as ‘dirty dare’.
“The child appears to have lost an arm-wrestling match, one child held him down while another pulled down his tracksuit bottoms and sexually assaulted him.”
She alleged that the incident lasted for around 10 seconds.
A week later the incident was reported to a sixth-form mentor and then referred to a child protection officer at the school.
Pressed by Mr Justice Maguire to define what was under challenge, the barrister contended: “There’s a continued failure to convene a meeting of the board of governors.
“There are other children within the school, and if there’s a culture of this behaviour that is potentially sexually harmful that is something the board of governors ought to address.”
Donal Sayers, representing the school, argued that senior teachers have put measures in place to deal with concerns.
He also indicated that a meeting will take place to explore any disciplinary measures once a police investigation is concluded.
Adjourning the application for leave to seek a judicial review, Mr Justice Maguire asked for more detail on the legal basis for the challenge.
He also pointed to the potential delay in bringing proceedings that should only be focused on any alleged illegality.
“I’m not here to tell public authorities the court thinks they are simply wrong on the merits of what they do,” he stressed.
“Only if they act irrationally, unreasonably or in breach of human rights can the court intervene.”