The Pars prevailed into the second round, however, after a first half goal from Andy Barrowman and a second after half-time from Andy Kirk for the Scottish Premier League new-boys.
It was Annan that had the first scoring chance of the match after three minutes when Sean O'Connor's close-range shot from six yards was blocked by Pars keeper Paul Gallagher.
Just moments later, at the other end, Kirk nearly scored a stunning goal when his shot from 18 yards struck the crossbar and went over.
Third Division minnows Annan seemed able to match their SPL visitors in every area of the park and looked as if they were about to take the lead through O'Connor in the 12th minute.
The ball took an awkward bounce in the six-yard box which confused Gallagher but O'Connor's shot was not powerful enough to beat him.
Paul Burns nearly scored for the visitors three minutes later but his powerful shot from six yards out was pushed round the post by Annan keeper Craig Summersgill.
But Dunfermline's pressure paid off in the 17th minute when they took the lead through Barrowman.
Burns played the ball in from a corner on the right-hand side and Barrowman rose above the defence to powerfully steer it into the net with his head.
But Annan were soon level.
The home side pushed forward from defence in the 21st minute and David Cox picked up the ball just in front of the 18-yard box.
He twisted and turned to avoid three challenges from the Pars defence before firing the ball into the back of the net.
Annan could have gone ahead in spectacular style in the 32nd minute when Barrowman had an overhead scissors kick blocked by Dunfermline's John Potter on the goal line.
The visitors came out in the second half looking hungry for victory and scored again in the 51st minute when Kirk headed in from close range from a Joe Cardle cross.
Dunfermline tried to control possession in the second half but Annan showed they were more than able to cope and continued to try and get back up the park.
The Pars had the ball in the net in the 70th minute but Barrowman was judged to be offside in the six-yard box when he slotted home substitute Liam Buchanan's pass from the left-hand side.
Annan tried desperately in the dying minutes to level the score and should have taken advantage of an excellent cross in the 85th minute from David Cox which was played into the box from the left-hand side with no-one waiting in an empty box to pick it up.