The young French striker finished off a well-worked move in the 44th minute to secure a first home win since February 4, following four draws and one defeat in the last five matches at Victoria Road.
It was a splendid effort from Roger Cross' side. Shaun Byrne's late withdrawl had meant that, for the first time this season, the starting line-up contained not a single player with any first team experience.
However, against a well-organised and settled Derby team who won the Reserve League South for two years running in 1999-2000 and 2000-01, the young Hammers more than held their own and enjoyed the better of the play in the first half.
Sofiane saw two long range efforts fly narrowly wide in the first 20 minutes, while a couple of low crosses bounced agonisingly across Derby's six-yard box.
With Elliott Ward and Clive Delaney forming a solid partnership at the heart of the Hammers defence, Derby struggled to find much space up front and didn't muster a single shot on target before the interval.
As the half drew to an end, the game was evenly balanced, but Hammers made the vital breakthrough just a minute before the break with a superbly worked goal.
Daryl McMahon's clever pass released Darren Blewitt down the left and the young full-back fired in an excellent low cross that was met by Sofiane, who turned the ball in off a defender from three yards out.
The young French striker should have added an immediate second when he was sent clear on the left, but Derby keeper Lee Grant kept out his first effort and then scrambled back to his line to collect a second shot.
Sadly, Sofiane's evening didn't last much longer. Just six minutes into the second half, he pulled up sharply with a hamstring strain and was replaced by youngster Ayo Akinsete, who added some extra strength to the forward line.
Hammers then came close to doubling their lead, when Ward headed McMahon's corner just wide of the post from 10 yards out, and their escape seemed to lift Derby, who then enjoyed their best spell of the match and came close to finding an equaliser.
The hosts had goalkeeper Raimond Van der Gouw to thank in the 56th minute when he pulled off a stunning double save, first denying Twigg with a point blank save and then amazingly keeping out the follow-up effort from O'Halloran.
The visitors then had a goal ruled out for offside, before substitute Kuduzovic fired over the bar from a good position after bursting clean through in the 65th minute.
After weathering the storm, Hammers rallied again and Pearson saw two snapshots saved by Derby keeper Grant, while Akinsete fired over from 20 yards out after turning well.
It looked as though a two-goal cushion might be needed, but Delaney and Ward held firm in the closing stages as Derby resorted to launching the ball forward, and Hammers held on for a welcome triumph.
Hammers: Van der Gouw, A Ferdinand, Blewitt, Delaney, Ward, McClenahan, D Noble, McMahon, M Cole, Pearson, Sofiane (Akinsete 51). Subs unused: Forde, Laws, Bunce, Tattam.