They became only the second team to win a League game at Victoria Park in 16 months, and were full value for the three points.
In the first half they had to survive a battering from the home team, who missed a string of chances when they should have done better.
Chris Shuker and Eifion Williams were both off-target twice, while Joel Porter and Ritchie Humphreys also went close.
But the story changed completely in the second half when City took control.
They went in front on 53 minutes when Lee Miller created a chance wide on the left for Lee Peacock and he finished it off well with a low shot into the far corner for his 14th goal of the season.
But Pool were not beaten yet, and on 69 minutes they drew level when Mark Tinkler met midfield partner Gavin Strachan's right-wing corner with a powerful header that gave Steve Phillips no chance.
It was clearly going to take a special goal to win an end-to-end game, and that's exactly what happened on 75 minutes.
The impressive Peacock was behind it again with a neat lay-off that gave veteran Brian Tinnion the chance to blast a spectacular 25-yarder into the roof of the net.
That took the wind out of Hartlepool's sails and they struggled to get back into the game, though they did have two penalty appeals turned down in a hectic finish.
"This game was our sternest test of the season," said City boss Danny Wilson.
"We battled hard to stay in the game up to half time, then after the break we were different class.
"We scored two good goals and nobody can argue with the scoreline in the end."Hartlepool manager Neale Cooper added: "City came here with a tremendous record and they showed us why they are up with the leaders.
"We had our chances in the first half, but just didn't take them."