From what I see, it seems like you guys were trying to bait this whole thing into happening by repeatedly harassing the cop (Video doesnt show reason as to why you are doing it)
When you guys repeatedly punch him from behind and gang up on him 5-1 I can clearly understand his reasoning as to why he would pull out his gun.
I also dont see why you thought it would be a good idea to pull a weapon on an officer, who by the way has already called for backup, is close the PD and already has a weapon out in attack stance.