The jury has been shown a video of a police interview with the young witness carried out the day after Liam was found dead at a house in Fife on 22 March, 2014.
In the interview, the witness said another boy had “done something bad, very, very bad, he’s killed (Liam).”
Rachel Trelfa or Fee, 31, and her civil partner Nyomi Fee, 28, deny murdering the two-year-old and falsely blaming his death on another young boy.
On day ten of the trial at the High Court in Livingston, the jury heard the young witness say he had been playing with the other child in a room at the house as Liam slept in the room next door.
He said: “I think he sneaked out the door and into Liam’s room and put his hand over his mouth so he couldn’t breathe. Then he sneaked back.”
The witness said he did not see the other boy leaving or re-entering the room.
Asked by the police officer how he knew what had happened, he said Nyomi Fee “told me everything”. He added: “No-one else would have hurt him.”
The witness said Nyomi Fee had told him that Liam was white and not breathing, and that he had heard both of the accused “screaming and panicking”.
The jury were then played a video of a second interview with the boy three days later on 26 March, 2014.
The young witness is heard telling the police officer and a social worker the other boy did not leave the room when they were playing on the night that Liam died.
He was asked if he had ever seen the other boy put his hand over Liam’s mouth.
“No,” he replied.
He said that on one occasion a few weeks before the toddler’s death the other boy had “split Liam’s head open”.
He said he knew this because Nyomi Fee had told him about it.
The witness said on another occasion the same boy had broken Liam’s leg by “throwing him across the room”.
Again, the boy said he had not seen this happen but had been told about it by Nyomi.
“He couldn’t walk,” the boy said, adding that Liam did not go to the doctors.
He was asked by the police officer “Did you see him getting hurt?”
“No” he said. “Nyomi told me”.
The trial, before judge Lord Burns, continues.