The win maintained Saints' fine run of form ahead of next Sunday's Scottish Cup semi-final against St Mirren.
It was a different story for Hibs, who will take on Dundee United in the last four at Hampden next week, with Jack Ross' side off the pace for much of the game.
Hibs, whose lead in third place has been cut to three points by Aberdeen, were without 17-goal striker Kevin Nisbet.
The visitors clearly had one eye on the cup after manager Callum Davidson made seven changes.
A passive start to the clash suggested both teams had Hampden on their minds.
The only attempt at goal in the opening stages came after four minutes when Saints' stand-in goalkeeper Elliot Parish gathered a tame Christian Doidge header.
However, the visitors did take the lead through Middleton in the 22nd minute.
Porteous brushed Michael O'Halloran off the ball near the corner flag but then inexplicably tried to force a pass across his own box.
Middleton picked up the stray ball in a central position and swept a drive past the hapless Marciano.
Hibs continued to lack any real penetration in the final third, although Martin Boyle did bring a routine save from Parish after getting on the end of a Jackson Irvine cross at the back post.
The second half was much of the same as Hibs struggled for ideas.
Alex Gogic did at least threaten with an overhead kick from Boyle's corner but his effort sailed over the crossbar.
At the other end, Middleton was given a chance to add to his tally after a free-kick was awarded 20 yards from goal following a cynical Paul McGinn foul, but the former Hibs player's effort flew over.
Hibs forward Boyle did have the ball in the net moments later but his strike was ruled out for offside.
Both teams rang the changes as time ticked on but it was Saints who held on to claim the win.