A membrane separation process for treating a gas stream containing methane and nitrogen, for example, natural gas. The separation process works by preferentially permeating methane and rejecting nitrogen. We have found that the process is able to meet natural gas pipeline specifications for nitrogen, with acceptably small methane loss, so long as the membrane can exhibit a methane/nitrogen selectivity of about 4, 5 or more. This selectivity can be achieved with some rubbery and super-glassy membranes at low temperatures. The process can also be used for separating ethylene from nitrogen.