But Annan were reduced to 10 men when Andrew Aitken saw red for a tackle on David Gormley, who soon headed Elgin's first goal on 65 minutes.
Craig Gunn slotted home the hosts' leveller but Dempsie put through his own net in the 84th minute to hand the three points to Annan.
Elgin: Donnelly, Edwards (Lawrie 61), Duff, Nicolson, Dempsie, Cameron, Gormley, O'Donoghue, Frizzel (Barry Wilson 86), Crooks, Gunn. Subs Not Used: John Calder, Jack.
Booked: Nicolson, Duff.
Goals: Gormley 65, Gunn 69.
Annan Athletic: Summersgill, Peter Watson, Neilson, Aitken, Docherty, Steven Sloan, Gilfillan, Jardine, Cox (Steele 50), Harty, O'Connor (Felvus 70). Subs Not Used: Jamieson, Slattery, John Watson.
Sent Off: Aitken (48). Booked: Neilson.
Goals: O'Connor 12, Neilson 39, Dempsie 84 og.
Ref: Gary Hilland
Source: BBC Sport