The stabbing happened on Q Street near Childs Avenue around 6:30 p.m. Sunday night.
Merced police say two men in their mid-twenties asked the man if he was in a gang. Officers say they beat and stabbed the man after he answered no.
The man was taken to a Modesto hospital. His condition has not been released.