One render layer with background image and one with transparent background
Enable Transparent on the Film section and enable environment on your render passes. The background environment will be avalible by connecting the environment socket.