The P-51 was indeed in service during D-Day, and provided valuable air cover over the English Channel while the invasion was underway.
The Mustang was one of the best fighters of the war, in that it had a long range, great speed and maneuverability, and generally outmatched anything Nazi Germany could put in the air by 1944 (with the exception of the ME262 jet fighter).
The P-51 on D-Day was valuable for close air support in particular, and was used in a "tank-busting" capacity to take out German panzers approaching American lines as the invasion entered its first week.
The P-51D you mention in your question was the most widely produced variant of this particular fighter, and was in service by the time of the Normandy invasion.
Yes, the P-51 Mustang was already in operation in Europe by the time of the D-Day landings in Normandy.
The Mustang entered the war in Europe in early 1944, a few months before the landings, which happened in June.
The Mustangs were used for a variety of purposes. They did escort duty for bombers and they served as close air support aircraft for ground operations. Both of these helped a great deal in making the D-Day landings a success.
Perhaps most importantly, they helped to give the Allies virtually complete air superiority over the landing beaches.