Sean Maitland's try on the stroke of half-time had edged them into a 10-9 half-time lead before further scores from Tommy Seymour and man of the match Mark Bennett, coupled with 12 points from fly-half Finn Russell, confirmed victory.
It was a second-half performance which had Townsend purring with satisfaction and with a home game against rivals Edinburgh next up, the head coach insists his side are shaping up nicely.
"We've built up a bit of momentum now and tonight's victory was another important one for the club," he told their official website.
"The key game for us was probably the Leinster game about six weeks ago when we scored three tries over at the RDS.
"We played some really good rugby that night and almost came away with a win and since then we've won every game.
"I thought our attack was probably better last week in Munster but it was great to see the decisions the players were making like the decision of Finn Russell to switch with Mark Bennett for the try.
"We got more into the game in the second-half and it was a really good performance, one of our best 40 minutes of the season."
Follow us on Facebook, join the conversation on Twitter, sign up to our YouTube channel for extensive match highlights and sign up for our newsletter for regular updates on the RaboDirect PRO12.