Lee Gregory opened the scoring in the first half before Ben Marshall's stunner secured the points for the Lions midway through the second period - ensuring they remained in the play-off hunt.
The first quarter of the game saw limited action and it took Millwall 24 minutes to break the deadlock.
The Lions latched onto the ball in the middle of the park and Jed Wallace was able to pick a pass, playing in Gregory who found space inside the area and was able to roll the ball under Nick Townsend to make it 1-0.
Up until that point it had been all Barnsley. The in-form Oli McBurnie had a shot charged down in the opening 10 minutes while Mamadou Thiam looked lively down the right-hand side.
He was able to create two opportunities before the goal, seeing one ball in put over his own bar by Jake Cooper before Kieffer Moore's header was easily saved by Jordan Archer.
Gary Gardner, meanwhile, had a long-range effort as the game reached the half-hour mark, but his powerful shot was off target for the Reds. Liam Lindsay also had a chance, heading over at the near post from a corner just before half-time.
Millwall had created the better openings, though, and they could easily have been two goals to the good before the break.
On 34 minutes George Saville collected a loose ball inside the box before rounding Townsend in the Barnsley goal. However, with a flurry of Tykes bodies on the goal line, he fired over trying to find the roof of the net.
Barnsley could have drawn level as Moore was presented with two chances. He first saw a shot blocked by a Lions defender and then Archer did well to tip the striker's header wide.
On 63 minutes, though, Millwall did make it two. Marshall cut inside from the left and, 25 yards from goal, hit a spectacular effort which bent into the far corner. Townsend could do nothing as he watched the ball sail past him.
Archer was then forced into action again, getting down to deny George Moncur as the Reds looked to respond to going two goals behind.
The Tykes had responded well and but for a goal-line clearance from Cooper, they would have been back in the game as McBurnie's goal-bound header was hooked away in the nick of time.
Barnsley boss Jose Morais said: “I believe it is disappointing. Not only for me, but for the players.
“The reason why is that you prepare a game in a stable way, you come into the game in a strong way, and then in a situation you give the ball away and give away a chance.
“I also believe that when you make a mistake like this you need to recover and react. We took some time to react.
“We pushed the opponents. We tried and we created. We had chances to do it but we didn’t score. In front of goal we weren’t effective.
“We believed that we could score. We couldn’t do it and they had a good strike, it was a fantastic strike.
“I just felt disappointed. The game started to become more difficult because they are a good side. We are not getting the results we need to have.”