The Raeburn Place side had not won a match since November, leading to their coaches Jonny Else and Malcy McVie leaving the club earlier in the week.
Stewart's Melville on the other hand, who finished second in the RBS National League, had been in great form in recent months.
The contest proved to be as tight as many thought it would be for large spells of the afternoon.
After an evenly-contested opening 15 minutes, Accies took the lead with a try from Iain Berthinussen who was set up by a run from Jamie Farndale.
Eight minutes later Stewart's Melville got themselves on the board with a penalty from captain Nick McCashin.
The Kiwi added another as Stewart's Melville went ahead 6-5 before Alex Blair kicked one of his own for Accies to give them a 8-6 lead at the interval.
At the break Stewart's Melville back-row Adam Howie was forced off through injury to be replaced by the experienced Donald Sangster.
Accies started the second half well and Nyle Godsmark scored a good try to put them further ahead at 13-6 with a Blair penalty making it 16-6.
Stewart's Melville showed fighting spirit, spurred on by McCashin, as he scored a try and converted it. They then had more pressure before Jonathan Hamblin was yellow carded.
Accies took advantage and Callum Reid went over for the clinching try with Ruairidh Bonner converting to end things at 23-13.