Saphan Robinson was captured on CCTV as he jumped out of a Mercedes before waving the weapon at a car which was driving by on Jiggins Lane in Bartley Green.
Our detectives established that the car was being rented by Robinson at the time, on 22 July, 2019.
Officers searched his house and found the clothing that he was seen wearing on the CCTV.
The weapon has never been recovered, and it was not clear who it was being pointed at or why.
The passenger in the Mercedes was never identified.
Robinson, 30, of Nutfield Walk, Quinton, went on to admit possession of an imitation firearm, and was jailed for three years and two months at Birmingham Crown Court today (14 May).
DC Beth Weir said: “We may never know exactly why Robinson was brandishing this weapon in public.
“We’re committed to tackling gun crime, which causes real harm to communities and misery to families.”