The shooting shattered a windshield of a car parked in a lot and a window on the second floor of the office. There were no injuries in the incident.
Yamamoto, who was charged with violating the Swords and Firearms Control Law, has declined to comment on the case.
In the vicinity of the office, police later apprehended Yamamoto, who was in possession of one pistol.
The Masaki-gumi is an affiliate of the Kobe Yamaguchi-gumi, which formed last summer following the dissolution of the Kobe-based Yamaguchi-gumi. Police suspect that the shooting incident is connected to the split of the Yamaguchi-gumi.