The five, believed to be American, are receiving medical treatment. The extent of their injuries is not known.
The attack took place at a Nato base in Wardak province, east of Kabul.
It is the latest in a series of so-called “green-on-blue” attacks, where Afghans in the police or army attack international forces.
More than 20 foreign personnel have been killed in rogue shootings in Afghanistan this year.
On Sunday, three British soldiers were shot and killed by an Afghan policeman as they left a checkpoint in Helmand province, in the south.
International forces are gradually handing over responsibility for security to their Afghan counterparts.
Most of the 130,000 Nato-led troops will leave at the end of 2014.
On Tuesday, the US and Pakistan announced that Nato supply routes into Afghanistan would re-open after Washington apologised for killing 24 Pakistani soldiers last November.
The BBC’s Kim Ghattas, in Washington, says the US had resisted saying sorry as there is deep anger among Americans about the death of US soldiers in Afghanistan from attacks by militant groups with alleged connections to Pakistan’s ISI intelligence agency.
The decision on supply lines will save the US hundreds of millions of dollars in the run-up to withdrawal.