Exclusive Details

Gene Hackman pimp-slapped a homeless man who physically threatened the actor and his wife outside a New Mexico restaurant ... TMZ has learned.

Law enforcement sources tell TMZ ... the incident went down Tuesday as Hackman and his wife were leaving a Santa Fe restaurant. We're told a homeless guy named Bruce Becker approached them in a threatening manner.

We're told the incident escalated big time when Becker called Hackman's wife a "c**t" -- and then Hackman dished out some street justice ... slapping Becker across the face.

Becker then called the cops to report the incident.