Martin Stokes, of Lynton Close, UK, shouted racist abuse before driving into Shia worshippers outside the Al-Majlis Al-Husseini mosque, and speeding off.
The attack, which left three people injured, took place just after midnight on September 19 during Muharram, a sacred month of the Islamic calendar.
The 25-year-old pleaded guilty to dangerous driving, causing serious injury by dangerous driving and a religiously aggravated offence.
He was sentenced yesterday at Harrow Crown Court and was also banned from driving for seven and a half years.
The court heard that Stokes was parked up with passengers drinking and smoking in a car park close to the community centre in Horseshoe Close where a private event was taking place.
When asked to move on by the event stewards Stokes shouted racist abuse and then deliberately drove his car into a group of people who were leaving the centre before driving off.