I actually don't know the timeline. I wonder if people were using the expression "shooting for the moon" before Apollo happened, or if the moon race was what generated the phrase?
From what I can dig up casually, it looks like "moonshot" is from the space race, dating to 1958, but "shoot for the moon" might be earlier. And according to this, "shoot the moon" means to leave without paying rent: