The radial distribution of gamma rays and cosmic rays in the outer Galaxy