Beijing took the lead in the 11th minute through Michael Ngadeu-Ngadjui but Shenhua looked to have salvaged a point through Cephas Malele's 76th minute equaliser.
Wang Ziming, however, struck in the seventh minute of second half additional time to claim the three points for Beijing.
Shanghai Port are on 60 points with eight matches remaining while Shenhua are seven clear of third-placed Chengdu Rongchen, who defeated Changchun Yatai 4-0.