Tamir Cohen fired the Trotters ahead in Saturday's Premier League clash at Fratton Park after 13 minutes, only for Younes Kaboul to head Pompey level after 25 minutes.
Matthew Taylor's penalty put Bolton back in front four minutes before the break.
Kevin-Prince Boateng then struck an equaliser on his Portsmouth debut, but Cahill scored at the death to leave the home side without a point from five games.
Portsmouth handed debuts to midfielders Boateng and Jamie O'Hara and defender Tal Ben-Haim, while David James returned in goal following a knee injury.
Bolton newcomer Ivan Klasnic was forced to make do with a place on the bench, while Johan Elmander missed out after suffering a slight strain while representing Sweden in midweek.
After an uninspiring opening, Bolton's Cohen headed the first chance of the game over the bar from an excellent Sam Ricketts cross after four minutes.
Bolton's former Portsmouth midfielder Taylor should have put the visitors ahead after 11 minutes when he raced on to a through-ball from Gretar Rafn Steinsson.
He sliced his effort wide of the near post, but Cohen made no mistake two minutes later.
The Trotters hitman was sent clean through by an excellent Steinsson pass from the right corner of the box, and rifled the ball into the top corner.
Bolton nearly bagged a second after 22 minutes, but Taylor put Ricketts' ball from the right well wide of the post.
Portsmouth began to step up their game and levelled after 25 minutes.
O'Hara lofted in a superb corner from the right and Younes Kaboul hung in the air before he nodded the ball across Jussi Jaaskelainen.
Kaboul should have scored again three minutes later from another superb O'Hara corner to the back post, but he headed just wide.
The Fratton Park faithful were then left fuming on 41 minutes after referee Chris Foy gave Bolton a highly debatable penalty.
Trotters skipper Kevin Davies raced at speed into the Portsmouth box and his momentum carried him straight into Ben-Haim.
Foy pointed to the spot and Taylor stepped up, sent James the wrong way and slotted the penalty to the England international's right.
Portsmouth fans were baying for a penalty early in the second half after Tommy Smith tumbled when he raced for a loose ball, following a misunderstanding between Jaaskelainen and Bolton defender Zat Knight.
Foy waved their calls away but the locals were celebrating after 63 minutes, when Boateng put their side level.
Nadir Belhadj's ball from the left fell to O'Hara, whose shot was blocked, but Boateng was quickly on to the rebound and sidefooted home from 10 yards out.
Portsmouth surged forward in search of a winner and Kaboul blew another great chance to find the net, when his close-range effort from a Smith cross was cleared off the line by Steinsson.
Bolton substitute Chris Basham had the ball in the net after 83 minutes, but his effort was ruled out because of an infringement by Gavin McCann.
The Trotters made up for that when they left Portsmouth bottom of the table after Jlloyd Samuel's throw-in was flicked on by Chris Basham.
Two Bolton players strayed into offside positions in the melee that followed as Cahill headed into the bottom right corner to seal the points.