Bottom team Bath City boosted their Blue Square Bet Premier survival hopes with just a third victory of the season over fellow strugglers Newport County.
But loan striker Nat Jarvis gave County the lead, firing home after a shot by Adam Hughes had hit the post, before Bath scored twice inside seven minutes.
Adam Connolly's close-range strike was followed up by Sean Canham's effort.
Canham's solo run helped set up Scott Murray for Bath's third before Gary Warren's header gave County a lifeline.
But Bath held on for their second win in successive home games to move to within five points of Newport, who have won just twice in 10 league games, and safety.