In the other group, a second minute strike by Nur Ainaa Rahim was enough for Kuala Lumpur to beat Johor 1-0.
Terengganu took the lead off Nur Nazurah Razali in the second minute, but Pahang fought back and equalised in the 51st minute off Zati Alyani Zubir and the winner was scored 20 seconds from end by Nur Shazwani Zakaria.
Receiving a pass from J. Thibatharshini, Nur Shazwani cooly slotted in the ball to give her team-mates hope of playing in the final.
Pahang play Malacca today, where a win will see them in their first Under-16 final.
Pahang coach Sabri Mohamad said it was a jittery start, and luckly his girls scored a last minute goal.
"We have never played in the medal rounds of the National Under-16 so I believe my girls were jittery today," said Sabri.
"But after the second half, there was better effort from them and we manged to pull a 'rabbit out of the hat' in the dying seconds.
"Now, we aim to beat Sabah to play in the final," said Sabri.
Last year, Pahang finished seventh while in it was a miserable 11th in 2015.
RESULTS: Boys -- Group X: Johor 2 Kuala Lumpur 0; Group Y: Perak 1 Pahang 0.
Girls -- Group X: Terengganu 1 Pahang 2; Group Y: Johor 0 Kuala Lumpur 1.
FRIDAY: Boys -- Group X: Kuala Lumpur v Penang (7.15pm, Pitch I); Group Y: Pahang v Malacca (7.15pm, Pitch II).
Girls: Group X: Pahang v Sabah (6pm, Pitch I); Group Y: Kuala Lumpur v Malacca (6pm, Pitch II).