With Shanghai awared a spot kick for a handball just after the hour mark, Cahill stepped up to take responsibility and found the net - only for the referee to rule it out for encroachment.
However, the 35 year-old held his nerve at the second attempt to slot the ball home and celebrate in trademark style.
Earlier, Giovanni Moreno gave the host the lead on 44 minutes with a fantastic bicycle kick effort.
The win lifted Cahill's side to third on the CSL table - on 13 points from seven games - one match more than all other sides in the top eight.
In other results, Liaoning Hongyun and Shanghai Shenxin drew 1-1 while Guizhou Renhe suffered a 1-0 home loss to Chongqing Lifan.