The USA international took his tally for the season to seven, with James Collins pulling one back late on for the Hatters.
Barnsley had the first opening after three minutes, with striker Victor Adeboyejo swivelling to fire wide of the target.
Luton midfielder Kiernan Dewsbury-Hall’s instinctive 22-yard volley was straight at goalkeeper Brad Collins who gathered well, while Tykes forward Cauley Woodrow’s angled effort from outside the box missing the target.
Barnsley upped the tempo midway through the half as Callum Brittain was found unmarked in the area but his side-footed effort was straight at Simon Sluga.
Romal Palmer cleared the crossbar with another strike before the Tykes took the lead in the 27th minute.
Woodrow’s through-ball reached Dike and the on-loan Orlando City forward held off Matty Pearson before firing low beyond Sluga.
Ryan Tunnicliffe sliced well wide from 25 yards after the ball dropped invitingly for him, but a disappointing first period saw Hatters manager Nathan Jones make two changes for the start of the second half, bringing on Harry Cornick and Sonny Bradley.
It did not make a lot of difference, though, with Barnsley extending their lead on the hour.
Woodrow brought the ball forward from deep and when his shot was fumbled by Sluga, it allowed Dike to react quickest and prod home his second of the afternoon.
Callum Styles almost added a quickfire third but his drive was tipped behind by Sluga at full stretch.
Jordan Clark toe-poked wide after a decent move on Luton’s left and with 18 minutes remaining, Town really should have pulled one back.
Kal Naismith’s excellent delivery found Cornick at the back post, only for the forward to get his header all wrong, with the ball bouncing tamely through to Collins.
Dike almost had a third, shooting into the side-netting and he had a marvellous chance to secure his hat-trick when tripped by Pearson in the area.
The forward’s spot-kick was well-saved by Sluga, who then did magnificently to recover and somehow block Michal Helik’s follow-up.
Luton went straight down the other end to pull a goal back. Substitute James Collins was picked out by Kazenga LuaLua and he fired into the corner of the net from the edge of the box.
Dewsbury-Hall shot wastefully over and had a corner cleared off the line.
Dominik Frieser sent one off target for the visitors as they looked to seal the points, but when Pelly-Ruddock Mpanzu ballooned his stoppage-time attempt over it was job done.
Support The Yorkshire Post and become a subscriber today. Your subscription will help us to continue to bring quality news to the people of Yorkshire. In return, you'll see fewer ads on site, get free access to our app and receive exclusive members-only offers. Click HERE to subscribe.