It was all Hammers in the first 45 minutes and were rewarded with Michail Antonio's effort proving the only opportunity of any significance in the opening period of play.
Diafra Sakho had an excellent opportunity early in the second half before Gianeli Imbula equalised for the Potters with their first real chance of the game. Enner Valenica and Cheikhou Kouyate came close but it was Diouf who ended West Ham's excellent campaign on a sour note.
Slaven Bilic's side headed to the Britannia Stadium looking to end their excellent season on a high and a possible Europa League place and from the off they looked to determined to claim a final three points.
They were well on course when they took the lead after 23 minutes and were helped by the poor defending of Mark Hughes' side as Antonio was allowed to bring down Winston Reid's knockdown on his chest before hitting it beyond veteran Shay Given and Imbula on the post.
He could have added his and the Hammers' second moments later when he was given more freedom on the edge of the box but this time the effort was just over the crossbar.
Stoke's first opportunity of any recognition didn't arrive until five minutes from the break as Bojan looked for the spectacular as he tried the curling effort from distance but it was just wide of the post.
Back in it
Their dominance continued into the second period and were denied a second goal in spectacular fashion. Antonio had proven a menace and was at it again as he burst beyond the Stoke defence and laid it on a plate for the sliding Sakho but Given got across his goal to save the effort.
Darren Randolph had hardly been troubled in the opening 54 minutes but found himself picking the ball out of the net as Stoke equalised with one of their first attacks of the game.
Club record signing, Imbula had proven a good signing from Hughes and he continued to repay his managers faith as he was allowed to charge forward and allowed time to pick out Randolph's bottom corner in style.
Pushing and pushing
As time went on the Hammers continued to push to help their top-five ambitions and let two golden opportunities pass them by.
The first came from the substitute Valencia as he looked destined from four yards out as he got to Mark Noble's ball but he somehow managed to put the effort wide.
He was involved again moments later when he went for the spectacular with the overhead kick from the corner which Kouyate managed to flick on but Glenn Whelan was there on the line to deny the midfielder.
Thrown it away
West Ham continued to battle as the game was coming increasingly to it's conclusion but all their hard work went down the drain as Stoke managed to steal the three points right at the death.
It was a poor way to end the season especially from a defensive stand point as Diouf was allowed to break free from his marker at the corner and he made no mistake as he powered his free header beyond Randolph.