It would probably be open to interpretation and action would depend on what the UK did, what Russia did and how good a case the UK could make. This is because HMS Defender was not obviously operating in a NATO zone.
Citing the treaty:
Article 5
The Parties agree that an armed attack against one or more of them in Europe or North America shall be considered an attack against them all and consequently they agree that, if such an armed attack occurs, each of them, in exercise of the right of individual or collective self-defence recognised by Article 51 of the Charter of the United Nations, will assist the Party or Parties so attacked by taking forthwith, individually and in concert with the other Parties, such action as it deems necessary, including the use of armed force, to restore and maintain the security of the North Atlantic area.
Any such armed attack and all measures taken as a result thereof shall immediately be reported to the Security Council. Such measures shall be terminated when the Security Council has taken the measures necessary to restore and maintain international peace and security .
Article 6
For the purpose of Article 5, an armed attack on one or more of the Parties is deemed to include an armed attack:
- on the territory of any of the Parties in Europe or North America, on the Algerian Departments of France, on the territory of Turkey or on the Islands under the jurisdiction of any of the Parties in the North Atlantic area north of the Tropic of Cancer;
- on the forces, vessels, or aircraft of any of the Parties, when in or over these territories or any other area in Europe in which occupation forces of any of the Parties were stationed on the date when the Treaty entered into force or the Mediterranean Sea or the North Atlantic area north of the Tropic of Cancer.
No one, including the UK, has anything to gain from starting a full-on war with Russia on this, even if an attack had happened. And the UK, at 12 miles out, carefully chose to stay out of actual territorial waters of Crimea, whether that is Russia or Ukraine.
After 45 years of Cold War posturing, the communication channels are most likely well-enough developed to avoid an accidental war.
If an actual attack had taken place, which it did not, one would expect more sanctions against Russia, though not UN-backed due to Russia's veto.