The result came after a recount of the votes that took another five hours, subsequently ending 13 hours after the polls closed at 6pm.
A government statement said the initial count of the votes came to a very close result between Mr Scotty and Pyon Deiye with one-16th of a per cent difference between them.
Under the new amendment act, the Returning Officer for the elections, in this case the Electoral Commissioner Joseph Cain can initiate a recount to ensure accuracy.
There are 716 registered voters in the Constituency of Anabar that comprise the districts of Anabar, Ijuw and Anibare; 612 votes were cast on election day, with 591 being valid votes and 21 invalid votes.
The government statement said 104 voters that failed to turn up to cast their votes will face financial penalties by the electoral commission.
Mr Scotty was first elected into parliament as a member of his constituency in the eighth parliament in 1986 and maintained his position until marginally losing in the 2016 general elections.
He served in the cabinet of former president the late Bernard Dowiyogo in 1992 in the eleventh parliament, then speaker of parliament for the first time in April 2000, before being first elected president of Nauru in May 2003.
The by-election comes after the court conviction of former MP Jaden Dogireiy disqualifying him from serving as a member of the Nauru parliament.