The attack, in which at least 67 people were killed, was claimed by Somalia's Al-Qaeda-linked Shebab insurgents.
Police constable Ali Niraj, who had been guarding a security van delivering cash, said after hearing gunshots he saw two of the attackers wearing bullet proof vests and carrying AK-47 rifles.
At first unsure if they were fellow police or thieves, he said that after they fired at him, he "returned fire to prevent them from using the escalator" to come up to the next floor.
But the attackers continued, even hurling a grenade at him, but it was deflected after hitting a pillar.
More From This Section
"I had run out of ammunition but since they didn't know that, I made it look like I was firing at them and they took cover," Niraj told the court.
Witnesses in the mall described how the fighters stormed the crowded complex, firing from the hip and hurling grenades at shoppers and staff.
The trial in Nairobi, which opened Wednesday, is hearing evidence from people who were at the mall when the gunmen launched their attack in September.
The accused are charged with lending support to the attackers.
The charge sheet gives no details of the nature of their alleged support, but security sources say the prosecution will argue they helped provide logistical support for the gunmen, including organising accommodation.
On January 21 the court will visit the crime scene at the still closed mall. The trial proper in the courthouse resumes on January 27.
All the gunmen in the Westgate siege- understood to have totalled four, not the dozen that security forces initially reported- are believed to have died during the attack, according to the US Federal Bureau of Investigation.
They said the attack was a warning to Kenya to pull its troops out of southern Somalia, where they are fighting the extremists as part of an African Union force.