There is probably a much, much better way of going about this but one way is to go to the layers with the ball and the bar and under Layer, untick Sky for both. Since this will remove the background from both those layers, just create another RenderLayer that will just be the sky.
Now if you use an Alpha Over node, you can choose which object appears over which one by switching the inputs. You will then use another Alpha Over node to get back the background.