Having suffered back-to-back Premier League 2 defeats the Hammers were looking for a return to form and it duly arrived thanks to two first-half strikes.
Martinez (pictured, top left) gave the visitors the lead on 20 minutes when he headed in Ben Johnson’s cross.
Samuelsen (pictured, top second from left) doubled their advantage when he cut in from the wing, exchanged passes with Martinez, and beat Michael Would.
Sunderland, featuring Duncan Watmore up front, pulled a goal back on 36 minutes through Luke Molyneux but Terry Westley’s side held on for a win that lifts them to fifth place in Division 1. The Black Cats lie 10th.