Is the Spitfire scene in Dunkirk (2017) based on a true story?

by GranTurismo364

I've kept the question in here to keep from spoiling the film for others, anyway, in the film, a Spitfire pilot loses engine power as the reserve fuel depletes. Since he can't return home from sea without power, he decides to land on the beach at Dunkirk but not before shooting down a German bomber attempting to strike oil-filled water. Once he glided to a smooth landing, he set the Spitfire ablaze before he was captured by the German forces.

Was this sequence written for the film, or was it inspired by true events?

Sjoerder

You may also be interested in the Dunkirk mega thread, where /u/The_Alaskan says a Spitfire landed on the beach.