A group of three men shouted Islamophobic abuse as they drove past the place of worship on Cannon Street Road, eyewitnesses said.
They called people attending Friday prayers “terrorists”, they added.
A few worshippers followed the blue car, only for the men to climb out of the vehicle and attack one of them with a weapon, thought to be a hammer. Police said the 27-year-old victim sustained head injuries.
The two groups fought before the men climbed back into the car and drove away.
In a clip filmed by a witness, one of the alleged attackers can be seen clinging to the car's bonnet in an attempt to get away.
"The suspects returned to their car and left the scene before police arrived," a spokesperson for London's Metropolitan Police said, adding that officers were called to the scene at around 1pm on Friday afternoon. Enquiries are ongoing to trace this vehicle. The suspects are all described as white men, believed to be aged in their 20s."
The London Ambulance Service was called but the 27-year-old victim was driven to an east London hospital by friends instead.
"At hospital, it was established that the victim had sustained a head injury, which was not believed to be serious," the spokesperson added.
"However, he was abusive towards hospital staff, and left the hospital without being treated. Investigations are ongoing and officers have not identified any motive for the attack."
No arrests have yet been made.
The alleged assault occurred the same day 49 Muslims were killed in a terrorist attack at two mosques in New Zealand.
Following the New Zealand attack police officers in the UK stepped up patrols around mosques on Friday.
Officers were deployed to provide reassurance and advice on protective security as Muslims attended Friday prayers around the country.
"Whilst there is no intelligence linking these appalling events in Christchurch to the UK, additional uniform patrols will continue in London and nationally over the coming days, focusing on places of worship and specific communities," Neil Basu, the national policing lead for counter-terrorism, said.
"We are paying specific attention to Mosques, particularly Friday prayers.
"Many communities will be understandably concerned and local officers will be out and about providing reassurance and protective security advice to communities, places of worship and businesses."
Sajid Javid, the Home Secretary, is also due to hold talks with anti-terrorism chiefs and security officials to discuss possible further measures to protect mosques in the UK.