Green looked set for an easy catch, but inexplicably the England goalkeeper let the ball slip and Ivan Klasnic was on hand to tuck away his fourth goal in four games, giving Bolton a 2-1 lead.
Bolton had gone ahead through Lee, only for West Ham to hit back through Alessandro Diamanti.
But Klasnic's gift from Green and a third by Cahill sealed three points for Wanderers, who moved above the visitors into 17th place.
The Hammers are now second from bottom and also suffered a blow when injury-plagued midfielder Kieron Dyer had to be substituted midway through the first period.
Gary Megson named an unchanged Bolton line-up, rewarding his players for their impressive showing against Manchester City, while Gianfranco Zola brought Dyer into the Hammers side for his first start in three months.
Bolton started the game in purposeful fashion, Kevin Davies seizing on an error by Jack Collison in the first minute and rifling in an effort that was deflected just wide.
Dyer was fed neatly by Herita Ilunga after playing a one-two, but the former England international could only shoot tamely at Jussi Jaaskelainen from the edge of the box.
A minute later Scott Parker brought down Tamir Cohen but Matt Taylor's free-kick was collected by Green after bouncing off Danny Gabbidon.
The hosts were in the ascendancy, but picked up two needless bookings in the 22nd minute when Davies bundled into Green after the goalkeeper had caught the ball.
Referee Andre Marriner showed the Wanderers captain the yellow card and a minute later took Klasnic's name after the Croatian made his feelings about the decision known.
Bolton continued to press and Cahill was unlucky to misdirect a header wide from Paul Robinson's cross before the unfortunate Dyer was forced to come off, with Junior Stanislas the man sent on to replace him.
West Ham were looking deflated but Bolton's confidence was growing, with Fabrice Muamba and Taylor both trying their luck on the half-hour mark.
Zat Knight then failed to guide his header on target from Lee's corner while Cohen could only hook a shot over the bar from the Korean's lay-off.
Lee was looking lively on the left and minutes later had cut inside his man and found Klasnic in space.
The in-form striker tried to pick his spot from just outside the area but his drive was rising too fast and West Ham survived again.
Half-time did not seem to interrupt Bolton's rhythm one bit and they were back on the attack again almost immediately after the restart.
Lee badly miscued a volley after the ball had dropped to him in the area in the 50th minute and Cohen did better shortly afterwards having connected with Knight's header, but the Israeli saw his shot deflected for a corner.
It had been almost entirely one-way traffic, but West Ham finally lent some creativity to the game on the hour.
Diamanti lofted the ball to Guillermo Franco, who almost worked his way into a one-on-one with Jaaskelainen before Knight made an excellent intervention.
Cahill then broke free at other end to send in a low shot that Green could only parry, but the Hammers hit back again on the counter-attack, Parker creating an angle and hitting a fierce effort that Jaaskelainen tipped over.
Bolton's earlier supremacy was finally rewarded in the 64th minute when Klasnic split the West Ham defence perfectly with a through-ball that left an easy finish for Lee.
But the lead lasted just five minutes as Franco found Collison in the Bolton box, who teed up Diamanti to lash the ball past Jaaskelainen.
It looked as if the hosts might be left to rue their earlier profligacy in front of goal, but it was an error from Green that let them off the hook with 13 minutes to go.
The impressive Lee was involved again, pulling the ball back to the edge of the box for Cahill, whose bouncing effort seemed harmless enough.
Green looked set for an easy catch, but the England goalkeeper blundered and Klasnic snaffled up the chance.
Klasnic was then substituted and replaced by Chris Basham, who forced a diving save from Green with a long-range effort with two minutes remaining.
Fellow substitute Ricardo Gardner took the resulting corner and found Cahill rising tallest at the far post to head home and wrap up the points.