Raw water transportation pipelines are vital in an urban water supply system for transporting raw water to drinking water treatment plants. This study investigated the effects of pipe material on nitrogen transformation, microbial communities and characteristics of related function genes in paint-lined steel pipe (PLSP) and cement-lined steel pipe (CLSP) raw water model systems. We established quantitative relationships between specific functional genes and change rates of nitrogen pollutants, which were verified by field investigation on nitrogen pollutant transformations in real raw water transportation systems. The results showed that the CLSP produced higher ammonia nitrogen (NH4+-N) transformation rates and higher effluent concentrations of nitrate nitrogen (NO3−-N) and dissolved organic nitrogen (DON) than the PLSP. Both pipes achieved high and stable nitrite nitrogen (NO2−-N) and low total nitrogen (TN) removal efficiency. Nitrification was found to be the dominant process in both model systems, especially in the CLSP. Characteristics of microbial communities and nitrogen functional genes, which were analysed by high-throughput pyrosequencing and quantitative polymerase chain reaction (qPCR), respectively, varied between the two pipe systems. Nitrogen transformation pathways, identified by path analysis, were also different between the PLSP and CLSP due to different microbial community characteristics and synergistic effects of nitrogen functional genes. In the CLSP, (NH4+-N→NO2−-N) with part denitrification, was the primary transformation pathway of ammonia nitrogen (NH4+-N), while only ammonia oxidization contributed to NH4+-N transformation in the PLSP. (NO2−-N→NO3−-N) was the main pathway involved in NO2−-N transformation and NO3−-N accumulation. The TN removal showed complex relationships with nitrification, denitrification and nitrogen fixation processes. These findings provided molecular-level insights into nitrogen pollutant transformations during the transportation of raw water through different types of pipes and technical support for the selection of raw water pipe materials. In our study area, the Taihu basin, China, PLSP was better than CLSP for distributing raw water in a short transportation distance, due to the lower effluent concentrations of DON and NO3−-N and less abundance of microorganisms.