(I'm not sure if I'm misunderstanding the problem here. If I am, please ignore this post.)
Wujohn:
Different metals are connected to each other all the time without concern for galvanic corrosion. For example, it's common to screw a steel gas pipe into a brass gas shut off valve or an aluminum gas valve without concern for the steel rusting or the aluminum corroding. And, in the case of a steel gas pipe, brass shut off valve and aluminum gas valve, those different metals can be in contact for decades without any significant amount of corrosion of any of them.
Lemme help you understand what to believe and what to ignore on the internet:
To have galvanic corrosion, you have to have THREE things:
1. different kinds of metals
2. those metals being in electrical contact, and
3. those metals simultaneously being in common contact with the same ELECTROLYTE.
(An "electrolyte" is a fluid, typically a liquid, that can conduct electricity. And, that's usually because that liquid has ions dissolved in it, like salt water with Na+ and Cl- ions.)
If any one of those things aren't present, then you can screw anything to anything and not have a problem with corrosion.
If this is a GAS line, then if the gas line is indoors you won't have any galvanic corrosion because gas is not an electrolyte. Neither natural gas nor propane gas can conduct an electrical current the way tap water (albeit a weak current) or especially, salt water, can. (Otherwise screwing a steel gas line into an aluminum gas valve would be a house explosion waiting to happen, but that's done all the time and it's safe cuz natural gas isn't an electrolyte and can't conduct electricity. So, in that case, #3 is missing.)
If the gas line is outdoors, then there is the possibility of the piping getting wet on the outside from rain, morning dew, lawn sprinkler or perhaps dog or drunk urinating. Fresh water (like rain) is an insulator, or at best, an extremely weak electrolyte because it doesn't have any hardness ions in it like tap water does. Urine, on the other hand, is more like salt water and will conduct electricity and cause you problems.
In the case of urine (or even tap water) you can have galvanic corrosion on the exterior of your piping cuz then you could have dissimilar metals in electrical contact and simultaneously being in contact with the same electrolyte (namely the film of urine or tap water on the outside of the piping).
I fully agree with the previous post that if you paint your piping with a high gloss oil based paint, or even wrap it well with stretchy tape (like electrical tape), or put on a pair of latex gloves and slather it silly with silicone caulk, or go nutz and do all three, that'll prevent any moisture of any sort being in common contact with any of the metals, thus preventing galvanic corrosion occurring on the exterior of the piping.
(If you use silicone caulk, I'd spray the piping with WD40 and give it time to dry before schmearing on the silicone. Or, wrap with electrical tape and then apply silicone. That way, removing that silicone will be quick and easy in future should you ever need to.)
So if you coat your gas piping to prevent it getting wet from the outside, you won't have a problem no matter how many different metals in whichever order they're connected in. That is, the only place you could ever have a problem on a GAS line is on the OUTSIDE of your piping cuz that'd be the only instance where your different metals might be in common contact with the same ELECTROLYTE.
Hope this helps, but please ignore me if I misunderstood the problem here.
If it puts your mind at ease any, I graduated from the U of Manitoba in 1978 with a bachelors in mechanical engineering, but I majored in metallurgy (which includes the subject of corrosion of metals) cuz the small town I grew up in had a large steel rolling mill where I worked as a summer student and I was hoping to land a job there after graduating. But, a slow economy and even slower demand for steel got in the way and I never did work there as an engineer. However, I understood and still remember the principles of what I was taught all these years later. You forget what you memorize. You never forget what you understand.