If the drawings below are accurate, the resemblance is a bit odd, and profuse apologies if the topic was discussed before.
Could be a periscopic sight device for Hasselblad type camera?
It is the periscope for a vertically mounted gun camera (source: "FFVS J 22 in Detail", IPMS Stockholm)
Whatever it is, I very much doubt that it is a gun. It does not look like a Swedish 8-mm M22 or 13.2-mm M39, which were FN-Brownings. My best guess would be that it is an actuator rod for the tail wheel.
I suspect that the superficial resemblance results from the limited choices facing the designer of a fighter powered by a relatively low-power Twin Wasp radial: everything has to be compact and low drag. In addition to the differences mentioned above, though, the J-22 had a steel-tube fuselage, while the Messerschmitt had a light-alloy stressed-skin structure.Many thanks for the thoughts. After coming across drawings of unknown accuracy, I wondered if the two aircraft looked similar, and I got some answers.