Good call to the person who said you would be an unknown with a gun in an already elevated situation. If he approaches threatening you, then that is a different story.
I do think a random closeline or smashing with the car door could be acceptable though

Now - if you drive by a see an officer wresting on the ground with someone and the officer is alone...please do whatever you can to assist. At this point a gun may or may not be needed, but there are plenty of videos where armed truckers save an officer's life during a traffic stop gone wrong.