You could, but you don't have to. A little bit of gas will probably come out when you take out the fuel rail, but it's nothing significant. If you wanna purge the system, just lift your back seat and remove the plate above the fuel pump. Disconnect both the plugs out of the pump and start the car.. then let it die and crank a couple more times. Then you can safely remove the rail without worrying about fuel spillage.
FYI, if you disconnect the fuel pump the gauge needle will read empty until you disconnect and reconnect the battery as well.