There doesn't appear to be a counter spell equivalent, spell or process, in either of the 2e sources I have (Tome of Magic, Players Option: Spells & Magic) so if it did appear before 3e, it's in a more obscure source than either of those.
The first page of the thread covers it nicely. To sum up and fill in some gaps:
The ability to counter a spells goes back to
Chainmail, with it an innate quality of wizard figures.
oD&D refers to 'countering' of spells in terms of negated the effect --
light and
darkness spells negating each other,
stone to flesh vs.
flesh to stone, etc. Most other versions of the game keep some or all of this, with various rules for adjudicating what will win out (spell or caster level compares, last one cast, etc.).
B, BX, BECMI - I'm not finding anything. The Initiative systems used would not have been great for interrupt-like effects. That doesn't mean there isn't something out there in the vast array of BECMI rules (where game-changing rules would show up in the latest Gazetteer, etc.).
1st and 2nd ed AD&D allowed you to use
Dispel Magic to counter a spell as it is being cast (with all the initiative shenanigans that entails), but it was generally easier to just damage the caster.
D&D 3e did the same if you held an action, but along with
Dispel Magic, you could use your own prepared copy of the same spell (if you knew what they were casting .
D&D 4e had any number of immediate interrupt abilities, but no generalized power that specifically shut down anything that is considered a spell and not other things.
D&D 5e has the first* spell named
Counterspell, with the singular purpose of shutting down another spell
as it is being cast.
*barring anything discovered per the below conversations
Pretty sure there was a 1E (or maybe 2E?) spell called "Counterspell" printed in Dragon Mag at some point. But I could be confabulating and don't have time to scour my Drag Mag collection at the moment. While Dragon is "unofficial" material (for the most part) it is also the source for iterations of things that would should up in expansion material or new editions.
I'll see if I can find a list of 'spells printed in Dragon' and then go to my archive to corroborate.
At this point, I think arguing over officiality in the TSR-era editions is pointless -- both I don't think it matters what they said on the subject and because they didn't exactly follow consistent procedures on the subject (like publishing 'official errata' and the like). Particularly since the topic is just looking for presence/appearance.
2E Spells & Magic may have been the first official printing
Just did a search for 'counter' and didn't come up with any pertinent results. Did you mean a counterspell-like mechanic by another name?