David Howie, 18, was giving evidence at the trial of Lee Anderson, 31, who denies murdering Mr Ali at the Sunshine Grocers in Green Road, Paisley, on June 15, 2012.
Mr Howie, who is a student at Stirling University, told the High court in Glasgow that he went into to the store to buy vodka for a party.
When he entered the shop Mr Howie said: "I saw Javaid Ali and a man with a black hood. I remember Javaid's face looking tense."
Mr Howie said the man, who had kept his back to him, indicated that he should go first.
He was asked if he could see that man in the court and pointed to Anderson sitting in the dock.
Mr Howie was asked how certain he was and replied: "It is with a great deal of uncertainty."
The trial before judge Sean Murphy continues.