Glenavon hit back with two late goals to progress 1-2 against Ballinamallard in the fifth round of the Samuel Gelston's Irish Cup.