Justin Martin -- who appeared alongside Zac Efron in "High School Musical 3" -- was arrested Tuesday night ... after allegedly getting into a gun fight with police.
According to Boston PD ... officers on patrol heard gunfire, and when they arrived on scene .. they say Martin and another man were armed and running away. The cops started chasing, and Boston PD says Martin turned and pointed his gun without firing, but his cohort did open fire.
Officers fired back, and did not hit Martin ... but they managed to chase him down, and while arresting him, recovered a .22 caliber pistol.
A second armed male suspect was also busted when he approached cops and Martin.
Martin was booked for unlawful possession of a firearm, unlawful possession of ammunition and carrying a loaded firearm -- and 2 counts of assault by means of a dangerous weapon.
Martin's mother tells us she will try to bail him out after his court appearance Wednesday morning.
12:15 PM PT -- Martin pled not guilty to all counts. Bail was set at $35,000.