Field guns can reach out over 4,000 yards. You were at 2,500 yards if you were at 7,500 feet and even with horizontal seperation you were within range. I've hit bombers flying overhead at over 3K where their indicated alt on their altimeter would be 9,000+ feet.
No real mystery here, just a bit of luck, also, scores don't reflect ground gun accuracy and only the overall kill stats show ground gun kills.