Ravel Morrison and Modibo Maiga scored the goals for the Hammers in the first half, with Manuel Jose netting a consolation for the Portuguese Champions League qualifiers.
The home side scored with the first attack of the game in the 16th second when Joe Cole found Morrison in the box and the former Manchester United midfielder held off his man and calmly slotted the ball in.
They doubled their lead five minutes before the break when Maiga cut in from the right and fired past the visitors' keeper at the near post.
Manuel Jose gave the away side hope with a 30-yard strike that deflected in off the head of James Collins, but the Hammers held on for the win.
New signing Razvan Rat played the second half but Andy Carroll missed the game as he continues to make his way back from a heel injury.