The Cherry and Whites failed to score in the second half as they slipped to a defeat that puts their qualification hopes in the balance going into the final week of group games.
The Zurich Premiership club now find themselves needing a convincing win against Groups Six rivals Stade Francais next weekend at Kingsholm.
Even then Gloucester may find themselves missing out on a quarter final berth as they need results to go in their favour just to clinch one of the two best runners-up spots.
Director of rugby Melville is well aware that his players missed an excellent chance to pick up a victory on the road as they were beaten by two late David Humphreys penalties.
"A couple of little mistakes cost us dear," he stated. "Conditions played their part, but we did so much right in the game.
"We played the right game in those conditions, and it is so disappointing because we worked very hard.
"We gave away some cheap penalties and they kicked the points."
Despite the fact that qualification to the knockout stages appears unlikely for Ulster, coach Mark McCall was delighted with his team's performance in difficult conditions.
The narrow win, sealed by Humphreys' boot, preserved their unbeaten Heineken Cup record at their Ravenhill home.
"To win three games out of five in a group that also includes Stade Francais, Gloucester and Cardiff is not too bad," beamed McCall.
"It was tiring and we had a lot of defending to do. We stayed calm in the second half and picked up the points at the right time."