Armando Broja was brought down in the area, Kevin Friend awarded the penalty after a VAR check, which James Ward-Prowse converted in the 61st minute.
We made early pressure tell in the eighth minute as Mohamed Elyounoussi fired past a sprawling Lukasz Fabianski from the edge of the area after being fed by Kyle Walker-Peters.
Elyounoussi remained a threat on the break but squandered a good chance just past the half-hour mark. After connecting with Nathan Redmond's pass and skipping past Craig Dawson, he failed to connect properly with the finish and shot straight at Fabianski.
Four minutes after the break, Jarrod Bowen's corner was won by Dawson and substitute Michail Antonio, who had returned after a bout of Covid-19, was alert to head in from close range to equalise.
Moments after Declan Rice's shot whistled past the post at one end, Armando Broja was brought down in the area at the other. After checking the pitchside monitor following a VAR review, Kevin Friend awarded the penalty, which James Ward-Prowse converted in the 61st minute.
West Ham instantly hit back again, this time through Said Benrahma. He ghosted in at the back post to slam home Bowen's cross three minutes later.
Yet the twists kept coming as defender Bednarek rose highest to nod Ward-Prowse's pinpoint free-kick into the bottom corner, giving Southampton the lead for the third and final time after 70 minutes.