Beckford, making his 250th league appearance, followed up his double against Wolves last weekend to haul Town out of the bottom three.
The Jamaica international struck a goal in each half against Kenny Jackett's beaten FA Cup semi-finalists to sandwich James Vaughan's neat finish early in the second period.
But both players were later forced out of the game through injury and could be doubtful for Huddersfield's final two matches.
Beckford went close to giving Huddersfield the perfect start in the seventh minute, forcing Millwall goalkeeper David Forde into a fine save with a thumping header from 12 yards.
But Millwall enjoyed an equal share of early possession and went even closer to the opening goal when midfielder James Henry slammed a 25-yard shot against the crossbar from Jack Smith's tapped free-kick.
Beckford broke the deadlock in the 37th minute. The former Leeds forward was given too much space in the visitors' penalty area and curled an angled shot from 12 yards inside Forde's left-hand post.
Jackett's bid to chase the game was made doubly hard in the 55th minute when Vaughan slotted home Adam Clayton's pass from the edge of the area.
Vaughan then turned provider for strike partner Beckford, laying on a superb pass for the Jamaica international to run on to on the edge of the box and lash home, high into the net.
Town substitute Lee Novak's angled drive was well saved by Forde in the closing stages as the home side comfortably held on to their three-goal advantage.