Kirsten Dunst‘s co-star Simon Pegg became the fourth witness yesterday to blow away the weed-wacky defense of an accused burglar in a star-studded Manhattan trial.

The British actor — best known for roles in “Shaun of the Dead,” “Run Fatboy Run” and as “Scotty” in a recent remake of “Star Trek” — told a jury that he and Dunst were shocked to return to their green-room suite at the Soho Grand Hotel during a 2007 movie shoot and found their bags and electronics had been stolen.

Defendant James Jimenez, 36, of Coney Island, is hoping to beat the burglary rap by insisting he had permission to roam the hotel while it was taken over by the cast and crew of the movie “How to Lose Friends & Alienate People.”

His lawyer, Robert Parker, is insisting Jimenez was at the shoot with a friend who he claims was invited there as the on-location drug dealer — a convicted heroin felon currently serving time after copping to the burglary.

But so far, Pegg, Dunst and two assistants on the shoot have all testified that Jimenez and his friend most certainly did not have permission to be anywhere near the penthouse suite where the belongings went missing.

“Absolutely not!” Pegg insisted yesterday when asked if he even knew who Jimenez and his co-defendant, Jarrod Bienerman, were.

Summations in the case are scheduled for today. Jimenez, whose rap sheet includes shoplifting, gun possession and a car heist, faces up to 15 years in prison if convicted. He has turned down a plea deal for two years in prison.