The visitors had taken the lead nine minutes before half-time when debutant Tamas Priskin scored his first goal for the club just two days after arriving on loan from Ipswich.
Carlton Cole's header ensured the Hammers were back on level terms before half-time and Kevin Nolan's spectacular volley put them ahead after 64 minutes.
Mark Noble scored a third from the penalty spot midway through the second half to hand Derby their fourth successive loss.
The Hammers' evening started badly when Sam Baldock had to come off with a hamstring injury.
Shortly afterwards, Jack Collison nearly caught goalkeeper Frank Fielding out with a shot on the turn, but the Rams stopper was able to keep hold of the ball at the second attempt.
That, after 28 minutes, was West Ham's first shot on target and Derby responded by scoring with the game's next chance six minutes later.
Collison was caught in possession on the halfway line and that presented Jamie Ward with the chance to cut in from the left flank and find Priskin.
James Tomkins remained static, losing the Hungary international, and he fired the ball into the far corner to open his account for the Rams.
The Hammers were back on level terms one minute before half-time thanks to Cole.
The visitors had cleared Abdoulaye Faye's free-kick but Joey O'Brien sent a first-time cross back in which Cole directed past John Brayford who was covering on the line.
Baldock's replacement Frederic Piquionne nearly put the hosts ahead early in the second half.
Julien Faubert lofted a ball over the defence and the French striker brought the ball down expertly but his shot was blocked by Fielding.
Allardyce's side continued to press and they got their reward when Nolan fired them into the lead with a sublime piece of technique 19 minutes after the break.
Collison diverted the ball in the midfielder's direction and he waited patiently for it to drop before planting a first-time volley into the bottom corner of the net from 25 yards out.
The hosts then wrapped up the points 10 minutes later through Noble's spot-kick after Craig Bryson had pushed Piquionne in the box.
The contact was close to being just outside the box but referee Colin Webster appeared to have made the right decision in awarding the penalty which Noble slammed into the top corner.
It could have been worse for Derby had full-back Gareth Roberts not cleared Piquionne's glancing header off the line near the end.