David Moyes' team controlled the majority of proceedings against a spirited Sheffield United, who again paid a price for individual errors.
The result meant West Ham moved on to 42 points, jumping from sixth to fourth above champions Liverpool on 40.
A fourth win in their last six league games boosted West Ham's hopes of a place in European club competition next season, while keeping the Blades at the foot of the table with 11 points from 24 matches.
"If you look at last season when we were fighting relegation to where we are now, there's been a massive improvement," said captain Rice.
"It's massive to be in the top four and we need now to be pushing ourselves week in and week out."
The visitors received an early let off from VAR after Enda Stevens gave away a needless spot kick for a shove on West Ham defender Craig Dawson, as both were chasing the ball after goalkeeper Aaron Ramsdale had parried away a Rice free kick.
A VAR check found Dawson was offside when Rice struck the free kick, so the penalty was ruled out.
But six minutes from half-time, Blades defender Chris Basham tripped Jesse Lingard in another clumsy challenge to hand West Ham a first penalty of the league season, which Rice tucked into the corner.
Lingard again injected pace and energy into the West Ham attack as he continued to impress early into his loan spell from Manchester United.
West Ham doubled their lead when Diop headed home from Aaron Cresswell's corner.
Fredericks tucked away a shot deep in stoppage time after being set up by fellow substitute Said Benrahma to round off a satisfying evening for the hosts.