The Tigers, who twice came back from large deficits at the Stoop, took until the final 10 minutes of the match to go in front and now move to within one point of the league leaders in the Aviva Premiership.
"We said it was important at half-time, after we made some horrendous errors in the first half, that we had to win the game," Cockerill told Sky Sports News.
"Even when we were drawing, we had to go on and win the game because a draw or a bonus point was no good to us.
"To battle back and to win how we did in the end was a credit to the lads. To come here and win against Quins – who have been a good side all season – is a big win for us."
Cockerill's side host Bath at Welford Road in two weeks' time.