Substitute Don Hutchison struck in the 90th minute at Pride Park after a dour tussle in which clear-cut chances were few and far between.
The Hammers had a great opportunity to open the scoring after just four minutes when Wayne Quinn supplied David Connolly with the ball inside the penalty area.
Connolly jinked past the challenges of a brace of Derby defenders before his powerful shot was pushed away by Rams keeper Andy Oakes.
Midway through the first half, on-loan midfielder Niclas Alexandersson was close to breaking the deadlock when his rasping drive was tipped over by Oakes, although the referee missed the keeper's touch.
Derby responded by raiding down the opposite end as Candido Costa unleashed a searing drive which had David James scrambling across his line before breathing a sigh of relief as the shot went wide.
The hosts' best chance of the first period fell to Swedish striker Matthias Svensson but James was equal to the shot and parried the ball away.
The second half lacked the sparkle of the first as a spectacle, with goalscoring chances even more at a premium, with once more Connolly looking the most potent weapon for The Hammers.
He almost capitalised when Pablo Mills failed to cut out a raking pass, controlling the ball perfectly but his shot was superbly turned away by Oakes.
The home side immediately sprung an attack at the opposite end with substitute Marcus Tudgay delivering a pinpoint cross for Ian Taylor but the veteran midfielder headed over from close range after ghosting between Hammers defenders.
Inside the closing five minutes, Connolly was presented with another opportunity but headed into the arms of Oakes after an intelligent flick on by Hutchison.
But the visitors snatched the points in the final minute when a right wing corner found Hutchison in the centre of the area for the substitute to steer home a volley.
There was still time for Derby to create one last chance but Taylor's downward header was smartly gathered up by James.