To effectively counter a D9, aside from flying another D9 or meeting it with equal performance, you need something that excels in climbing and turning (compared to the D9 at that altitude). The D9 will outpace most any other aircraft at that altitude range, but it turns poorly. Since the D9 is forced to use the vertical, it's weakest point is when it's climbing and decelerating; the vertical transitioning period is where the D9 is weakest.
An aircraft like the Spit 8, Spit 9, Spit 16, Yak-3 (up to 16-18k), and Ki-84 (although its performance starts to degrade the higher it goes) will allow you this type of fight. All of them will perform close enough in climb performance to stay at the same altitude as the D9, and accelerate quickly, but will also allow you better low-speed handing.
Conversely, you can fly a Spit-14 or a 109K-4. Both are superior to the D9 at those altitudes (and the 109K-4 is actually faster as well), but they require an experienced use of the vertical, as they're less forgiving in angles fights and will tend to overshoot the D9 very easily due to their E-retention characteristics.
In this altitude range, the TA-152 is also a good choice, but it takes a more experienced pilot to use it effectively.
Planes such as the F4U series (except for the perked F4U-4, which outperforms the D9 above 9K) and the 51D are not good choices, at least in this altitude range, as an experienced D9 pilot will extend away, reverse using the vertical, and use acceleration to gain a vertical positional advantage over you. That's not to say that a good 51 or F4U pilot can't win a fight against a D9 at those altitudes, it's simply that with everything being equal, both planes are outclassed by the D9.