It happened just after 10:30 pm on Monday near 11th Street and E Street.
Merced police say the 28-year-old victim was driving when the group approached him and began firing shots toward him.
The man was hit at least once by the gunfire.
He drove to G and 11th Streets and flagged down someone for help. He is being treated at a hospital and is expected to recover.
Officers have not yet determined a motive for the shooting. Anyone with information is asked to call the Merced Police Department.