Dan Parks added a late penalty to ensure the victory for Lam's troops, who had trailed at the break after Roddy Grant's converted try for the visitors.
And the head coach was delighted with his side's response ahead of a trip to Italy next weekend.
"The win was what it was all about," said the former Northampton Saint.
"We can play better, we didn't take our chances and we have a lot of work to do. But this was one match we just had to win.
"Now we will head off to Italy and Parma next week and try to back it up against Zebre and push on from there."
For Edinburgh there were not that many positives to take but centre Nick De Luca is confident the good times are coming back soon enough.
"We've got a lot of new guys that came in today in their first game for the club so onwards and upwards from here," he said.
"Hopefully we can only get better but we're disappointed and we're hurting."
Follow us on Facebook, join the conversation on Twitter, sign up to ourYouTube channel for extensive match highlights and sign up to our newsletterfor regular updates on the RaboDirect PRO12