Beattie scored the only goal in the 82nd minute latching on to a pass from Fabrice Fernandes to score with a low shot past Kasey Keller.
But it was Tottenham who had the better chances and will have gone home to London feeling that they should have had at least drawn.
Niemi made a series of outstanding saves in the second half from Robbie Keane, Steffen Iversen and Teddy Sheringham.
In addition Keane broke free in the 58th minute and shot wide with only the goalkeeper to beat.
In contrast Saints, unbeaten at home this season had few opportunities and in the 75th minute Jo Tessem headed the best of those wide from close range.
In the first half, played in the teeming rain, Sheringham should have put Spurs ahead in the second minute but sent a free header from Stephen Carr header across the face of the goal.
At the other end Paul Telfer forced a great save from Keller from a long distance shot, but Tottenham began to dominate.
Glenn Hoddle, given a hostile reception on his return to Southampton, sent on Gus Poyet and Darren Anderton in the 67th minute, but they failed to press home their advantage and paid the penalty when Beattie snatched the winner.
Referee Mark Halsey played a key role in an exciting match, allowing it to go ahead after two inspections as the rain fell and then refusing to produce a yellow card all afternoon.