2002 NFPA13 (Sprinkler Systems)
10.6.7* When it is necessary to join metal pipe with pipe of dissimilar metal, the joint shall be insulated against the passage of an electric current using an approved method.
10.6.8 In no case shall pipe specified in 10.6.7 be used for grounding of electrical services.
(Annex-Explainatory material)
A.10.6.7 Gray cast iron is not considered galvanically dissimilar to ductile iron. Rubber gasket joints (unrestrained push-on or mechanical joints) are not considered connected electrically. Metal thickness should not be considered a protection against corrosive environments. In the case of cast-iron or ductile iron pipe for soil evaluation and external protection systems, see Appendix A of AWWA C105, Polyethylene Encasement for Ductile Iron Pipe Systems.