A witness, who cannot be named, told the inquiry his friend was kicked on the body and head by the Catholic sister.
He was giving evidence at the Scottish Child Abuse Inquiry which began the second phase of its hearings in Edinburgh on Tuesday.
It is hearing evidence about institutions run by the Daughters of Charity of St Vincent de Paul.
The man said he was sexually abused by a nun and another member of staff and beaten for bedwetting and not eating his food at Smyllum Park orphanage in Lanark, Lanarkshire.
The witness entered the orphanage in 1959 when he was aged around two, along with three brothers and a sister.
He said that beatings at the institution were routine, and that on one occasion when he was aged around six his friend was beaten after playing with a match and accidentally burning his hand.
He said: “It was unfortunate but at that time the sister came around the corner and said what’s wrong and I said ‘he burned my hand’ and she just grabbed him and started hitting him and punching him.
“He was on the floor and she was kicking him on his body and his head.
“I said ‘please sister, please don’t hurt him’.
“She stopped when I lay on top of him.”
He said he next saw his friend in the sick room and the inquiry heard the boy was in hospital for around 10 days before he died.
An investigation earlier this year found that at least 400 children from Smyllum Park are thought to be buried in an unmarked grave at the town’s St Mary’s Cemetery.
The orphanage was home to more than 10,000 children between opening in 1864 and closing in 1981.
Prosecutors have said there is no evidence that a crime has been committed at the orphanage in relation to reports of the mass grave.
The witness also told how he was sexually abused by a nun who took him to her room and rubbed his penis with her thumb while talking to him about bedwetting.
He also described abuse by a lay female member of staff.
The witness said: “She took me up to the bedrooms to help change the beds.
“She sat on the bed and opened her legs and she had a split in her ski pants and she told me to get my penis out, put it in there and go in and out.
“I cannot remember any penetration.
“She lay back on the bed and just said keep going in and out.”
He told how children who wet the bed were made to stand with the wet sheets round their neck in the morning, and were also hit for bedwetting.
In August 1965 when he was aged around seven the witness said he was moved to St Vincent in Newcastle, which was run by the same order of sisters, and told how he encountered abuse there too.
Colin MacAulay QC, counsel to the inquiry, said: “In your statement you go on to say it was another place run by psychopaths.”
The witness said: “We had to go to the washrooms and I must have said something out of line, she pinned me up against the wall with her forearm with a bread knife to my throat threatening to kill me and I genuinely thought I was going to die then, I was screaming.”
More than 60 residential institutions, including several top private schools, are being investigated by the inquiry, chaired by Lady Smith.