An eventful afternoon for Darryl McHardy started well when he netted for the home side on six minutes, before he levelled things up with an own goal before the half-hour mark.
Elgin regained their advantage just before the break through Brian Cameron before Craig Gunn struck in the second period.
The league leaders reduced their deficit in stoppage time through Matthew Flynn.
Michael Bolochoweckyj added a second 10 minutes later before Gary Fraser responded for the visitors in the second half.
However, the points were made safe through Scott McLaughlin on 71 minutes.
David McKenna had earlier opened the scoring for the victors before Sean Burns levelled up 11 minutes from time.
However, it was Wright who had the final say to give the bottom side an important three points at home.
Results in full: Arbroath 1-1 East Fife, Berwick 1-2 Stirling, Clyde 3-1 Montrose, East Stirling 2-1 Queen's Park, Elgin 3-2 Annan.