Barnsley have now gone seven home league games without a win, but it looked like that run was coming to an end as first Sam Winnall and then Marley Watkins put them in front either side of Lansbury’s long-range equaliser.
Apostolos Vellios levelled the scores again before Lansbury put the visitors ahead with a fine header during a frantic opening 45 minutes.
Ben Osborn grabbed a fourth for the away side after half-time shortly before Watkins saw red for a stamp.
Lansbury completed his hat-trick from the penalty spot late on after substitute Matty Cash was brought down in the area.
Barnsley went ahead with their first attack of note after five minutes. James Bree, making his 50th appearance for the club, burst down the right-hand side and delivered an excellent cross which Winnall headed home.
Forest also scored with their first serious foray into opposition territory after 12 minutes. Adam Jackson was penalised for going in high on Osborn, and from the subsequent 30-yard free-kick Lansbury played a one-two with Pajtim Kasami before firing a low effort past Adam Davies, who should have done better.
The hosts were back in front just two minutes later as Conor Hourihane’s clever chipped pass found Watkins, who having beaten the offside trap chested the ball down and steered it into the bottom corner of the net.
Once again Barnsley’s lead was short lived – Vellios equalising with a miscued finish to Danny Fox’s 23rd-minute ball from the left which looped over the hapless Davies.
Winnall saw an effort from a corner routine tipped over and Adam Hammill had one shot stopped by Vladimir Stojkovic and another whistle over the bar as the hosts began to dominate.
But it was the away side who took the lead for the first time on the stroke of half-time, with Lansbury heading Osborn’s cross from the left into the bottom corner from 12 yards.
Winnall missed a good opportunity to level the scores seven minutes after half-time when he headed Watkins’ cross agonisingly wide and Josh Scowen wasted some neat approach play from the hosts as he fired over the crossbar from the edge of the box.
Osborn got the goal his display deserved after 63 minutes when his well-placed header from a Michael Mancienne cross found the bottom corner.
Four minutes after falling two goals behind, Barnsley found themselves reduced to 10 men when Watkins was shown a straight red by referee Oliver Langford for stamping on Thomas Lam.
Substitute Cash was then bundled over by Scowen with eight minutes remaining, and Lansbury made no mistake from 12 yards.