But it must have lost its majority before the 2016 election, because at the time of that election (5 May 2016) it only had 64 seats, a minority. Since the 2011 election its seat number had fallen by five seats because of
the expulsion from the party of Bill Walker in 2012 (Walker later resigned his seat when he was convicted on 23 counts of committing acts of domestic violence, crimes for which he was sent to prison, and the seat was won by Labour in the Dunfermline by-election of October 2013)
presumably some other expulsions, defections to other parties, or resignations of the party's whip to sit as independents.
(Note that Dunfermline in 2013 was the only occasion during the 2011-16 parliament when a seat won by the SNP in 2011 was gained by another party in a by-election, but that seat had in fact already been lost to the SNP when Walker was expelled from the party in 2012.)
On what exact day between 2011 and 2016 did the SNP lose its majority in the Scottish parliament? By that I mean when did the number of members of the Scottish parliament who took the SNP whip fall below 65.