Rickie Lambert's hat-trick earned Southampton a club record 12th successive home league win to keep them a point behind leaders Brighton.
The home side had to come from behind after Ishmael Miller set up Matt Derbyshire for the opener.
Within 60 seconds Lambert's shot pulled Saints level, before he headed home David Connolly's cross on 24 minutes.
Just before the break Radoslaw Majewski's low shot made it 2-2, but a Lambert header late on proved decisive.
Lambert's hat-trick ensured a Southampton victory for only the second time against Forest in the last 19 years, with the last win having come in 1997 at the City Ground.
Another Forest win had seemed on the cards when Derbyshire converted Miller's low cross from close range.
But Lambert had other ideas, almost immediately equalising as the Saints striker beat Lee Camp from 10 yards out and then nodding home Connolly's cross from the right.
Forest regrouped and after a penalty appeal was ignored by referee Iain Williamson when Miller went down under a challenge from Danny Fox. Majewski's shot beat Kelvin Davis to ensure the visitors went in at the break level.
Southampton started the second half strongly and only a superb save from Camp prevented them from regaining the lead as he tipped Adam Lallana's shot around the post.
Lallana had another goalbound effort blocked by Wes Morgan, while Camp produced a fine save to keep out Morgan Schneiderlin's driven shot.
But with eight minutes left Lambert's goalscoring instincts enabled him to head home Fox's free-kick at the far post even though Camp got a hand to the ball.