Ngatapa midfield back Charlie Bennett struck back 21 minutes into the contest, flying 50 metres and cutting in and off the right sideline to score.
The conversion gave Ngatapa the upper hand 12-7.
Pirates regained the lead (14-12) in the 30th minute with a try to openside flanker Connor Paenga, converted by Aupouri.
Ngatapa opened the second-half scoring in the 54th minute with a try to left-wing Harry Hayward from a classic draw-and-pass play with centre Angus Allan.
It put their side 17-14 ahead.
However, as the game wore on, field position and possession started to tell for Pirates.
Pirates’ MVP Paenga snatched the win with a try set up by an excellent scrum 7m from the goal-line and quick ball.
“That was a great game,” said skipper Gray.
“It was fast rugby, with only the occasional scrum, and it was fun to play under lights.”