Lara struck 61, his highest score in Pakistan, but could not save his team from collapsing in 56.1 overs on a seaming but slow pitch on which Gul took 5 for 65, including 4 for 11 in his third spell.
Fellow quick bowler Shahid Nazir finished with 3 for 42, with three wickets for 12 in a destructive spell before lunch.
Gul, who took his second five-wicket haul at the Gaddafi Stadium, completed his 50 wickets in his 12th test and continued the collapse in the second session with Lara's wicket.
Lara made his runs from 106 balls with eight fours in a dour innings but just when he looked to be opening up he was caught behind as the last four wickets fell for 32 runs.
He shared partnerships of 44 with Dwayne Bravo (32) and 52 with Dave Mohammad (35) to shore up the innings after Nazir left them tottering on 52 for four.
Lara was made to rue his decision to bat first as Nazir exploited the overcast and murky conditions to rip through the top order with the wickets of Chris Gayle, Ramnaresh Sarwan and Shivnarine Chanderpaul.
His burst came after Gayle and Daren Ganga had put on 41 runs with the former hitting six fours in his 28-balls 34.
In the first over from Gul he hit two leg-side fours and in the ninth over he struck three successive boundaries before Gul provided the breakthrough by having Ganga caught in the slips.
Nazir, playing only because of the doping ban on strike bowlers Shoaib Akhtar and Mohammad Asif, won a lucky leg before decision against Gayle, who was hit on the thigh roll and given out by umpire Asoka de Silva.
He then had Sarwan caught by Younis for three and trapped Chanderpaul leg before for five runs.
Leg-spinner Danish Kaneria chipped in with the wickets of Bravo and Denesh Ramdin.