The Canadian came off the bench to make his first appearance of the season after shoulder surgery and marked it in style by sealing victory over the plucky Italians.
Glasgow now need to avoid defeat to Connacht at Firhill a week on Saturday to reach the play-offs.
Lineen said: “That was a special score from a special player on a special day.
“We had been holding him back for a couple of weeks despite the fact he was champing at the bit and pleading, ‘Get me on, get me on’.
“He saw a bit of space and went for it – that’s the kind of player he is. You look for moments like these when you come to a tough venue like this.”
Treviso took the lead after 10 minutes with a try from winger Brendan Williams. But Kris Burton missed the conversion.
After a 20th-minute drive from Ally Kellock, Treviso lock Corniel van Zyl was caught offside at the ruck and Duncan Weir slotted home his first penalty for Glasgow.
Treviso scrum-half Edoardo Gori and Kellock were sinbinned for fighting after half an hour.
Burton then missed a drop-goal effort before Glasgow full-back Stuart Hogg launched a counter-attack which saw Graeme Morrison go within yards of the Treviso line.
The Italians strayed offside and Weir kicked Glasgow into the lead for the first time after 61 minutes.
Treviso hit back with a Burton penalty five minutes from time and it looked like they would close out the victory when Ruaridh Jackson missed a shot at goal.
But the introduction of van der Merwe, right, proved decisive as he cut through the Treviso defence to touch down in the 77th minute. Jackson converted to wrap up the victory and keep the Warriors’ play-off bid on track.