The oldest written accounts are ambiguous on this point, so it is somewhat difficult to ascertain whether these two are not, in fact, merely aspects of the same tradition rather than two completely distinct, contradictory ones.
Hesiod, in his Theogony (c. 700 BC), simply says that Dionysus married Ariadne, with no mention at all of Theseus. The one source which is either as old as or even older than Hesiod is Homer's Odyssey, which contains a puzzlingly different rendition of the relationship between the wine-god and the Cretan princess.
Here, so we are told, Theseus took Ariadne from Crete with the intention of conveying her to Athens, "yet he had no joy of her, since, before" they could, apparently, consummate their union, Artemis killed Ariadne on Dia Island, seemingly at the instigation of Dionysus. Unlike Hesiod's Ariadne, who becomes "deathless and unageing," the Odyssey has Ariadne languishing in dank gloominess, in the land of the dead, long enough after her death for Odysseus to encounter her there when he adventures through the netherworld.
If we lay all that aside, though, and go only straight for clear and explicit information, the first time we encounter one of the versions of the story that you have specified is in Book 4 of Apollonius Rhodius' Argonautica in the 200s BC. In it, Dionysus marries
the fair young Ariadne, whom Theseus carried off from Cnossus and
abandoned on the isle of Dia.
The other version first occurs a couple of centuries later, in the Bibliotheca Historica of Diodorus Siculus. This plainly says that Dionysus snatched Ariadne "away from Theseus and kept her as his lawful wife, loving her exceedingly." Book 5 is even blunter, having Dionysus visit Theseus in a dream "threatening him if he would not forsake Ariadne" so that Dionysus might have his way with her.
Based on this evidence then, the first version to be written is the one in which Theseus leaves Ariadne behind without divine intervention.
I would note, speculatively speaking, however, that Apollonius could actually mean that Theseus' abandonment of Ariadne had been demanded of him but that this writer doesn't mention it because his original reader is already familiar with this detail and takes it for granted. This is bolstered by the fact that, even though, as aforementioned, the Theogony does not mention Theseus, there are ancient writers, namely Plutarch (Life of Theseus 20) and Athenaeus (Deipnosophists 13.557), who tell us that Hesiod does in fact refer to Theseus. Athenaeus goes so far as to inform us that it was on account of two other women, Hippe and Aegle, that Theseus
broke the oaths which he had sworn to Ariadne, as Cercops tells us.
In the Life of Theseus Plutarch claims that a certain Peisistratus deleted this verse "from the poems of Hesiod" which speaks of Theseus' reason for absconding on Ariadne:
Dreadful indeed was his passion for Aegle child of Panopeus.
If they are right about this then the older version is still definitely that in which Theseus is not coerced by any god into abandoning the Cretan princess but does so of his own volition.