New father Van der Merwe's touchdown and a series of successful kicks by Duncan Weir in wretched conditions have left the Scottish side a point behind Munster at the top of the RaboDirect Pro12 table as they go into their autumn Test break.
Townsend said: "Our ultimate team man DTH scored our winning try just after becoming a father for the first time. Great work. I am really proud of the players' response after a challenging week.
"With a number of players missing, it was always going to be a challenge but the players that came in did a fantastic job.
"We didn't have enough possession in the first half but the effort that went into the second when we were playing into the wind was excellent.
"We said when we'd won our first five games that it was a long way until the end of the season and one defeat doesn't knock you out of contention.
"There are four or five teams quite close at the top of the league but with a three-week break for internationals it was great to get that win.
"When we come back in, we can prepare for our next game with a bit of confidence."
Glasgow could not have wished for a brighter start as they put seven points on the board within three minutes. After a series of drives close to the line, Van der Merwe claimed the touch amid a pile of bodies, and Weir converted.
Mark Bennett then missed a long-range penalty before former Warrior Dan Parks scored Connacht's first points from in front of the posts.
Despite the conditions, the game became a fast-flowing and open contest as Glasgow built a lead - Weir kicking a penalty from a tight angle and Warriors almost scoring a try before Weir added to their tally.
Parks compounded a first-half miss by failing with another penalty six minutes after the restart as Glasgow struggled to make inroads into Connacht territory, but his next kick reduced the gap to seven points.
Another kick from Weir stretched the lead before both sides made substitutions midway through the half in preparation for the finale.
Two penalties from substitute Craig Ronaldson brought Connacht to within four points with 10 minutes remaining as they manufactured a sustained period of attack to put the visitors under pressure, but Weir's last-gasp penalty made sure of the Warriors win.