The visitors had the better chances throughout and were unlucky not to be ahead in the first half after Jon Routledge saw a shot blocked, while Stevie May also came close with two efforts.
But May opened the scoring when he fired into the net from just outside the box five minutes after the restart.
Routledge then added a second with a drive from just inside the box, which found the top corner 10 minutes later.
Darian Mackinnon later had two attempts at the Dunfermline goal blocked as Accies continued to look threatening.
On a disappointing day for Dunfermline Stephen Husband's shot was their only real effort on target.