Alex Dunbar and Duncan Weir ran in tries as the Warriors won 18-15 at Rodney Parade on Thursday evening.
"We had to play much better in the second period so that we could win as we didn't perform well in the first half," Townsend told Glasgow's website.
"We stepped up in the set piece and defensively we got a lot better."
Defending champions Glasgow moved up to fifth and now have 39 points from 14 games with Connacht currently leading the Pro12 with 50 points from 15 matches.
"We came out in the second half with much more resolve, determination and we were more direct which led to Alex Dunbar's try," added Townsend on the performance in Newport.
"We did enough to win but we put ourselves in a tricky situation after the first half.
"At half-time we spoke about fronting up as we weren't listening to the referee on a couple of occasions and we didn't look after ball.
"Gordon Reid performed a great turnover later on which illustrated how much we improved.
"Alex played well and was always looking to win the tackle contest. His run was excellent, picking up the ball from Mike Blair who also played well on his return.
"The players are delighted and the win helps boost us up the table a little more with eight games to go.
"We've got Cardiff at home in 10 days so we know that if we keep on winning we'll put pressure on those teams in the top four."
Head coach Gregor Townsend praised the "resolve" and "determination" of his Glasgow Warriors side after they secured victory over Dragons.