The Uruguayan forward planted a superb header into West Ham's net in the 22nd minute to give Liverpool the lead.
He was close to a second when he rattled the post with a ferocious shot as Liverpool dominated the early exchanges.
But West Ham grew in confidence and had a golden chance to level before half time but Jarrod Bowen's penalty kick was well-saved by home keeper Alisson.
Liverpool, lacking the intensity they showed in their 1-0 defeat of Manchester City on Sunday, struggled to contain a lively West Ham after the break.
West Ham would have taken a deserved point home had either Said Benrahma or Tomas Soucek converted great chances.
Victory lifted Liverpool into seventh place with 16 points from 10 games. West Ham's first defeat in four league games left them in 13th place with 11 points.