The 21-year-old took his goal tally to four in three games as the Buddies booked their place in the last eight.
Goncalves headed home to break the deadlock six minutes after half-time and doubled the hosts’ advantage eight minutes later.
Conor Newton called St Johnstone goalkeeper Alan Mannus into action with an effort from the edge of the box after 18 minutes and Steven Thompson struck the side-netting after combining with Goncalves two minutes later.
The visitors passed up a wonderful chance to open the scoring when MacLean was released by Gregory Tade, however the striker blazed over the top two minutes before half-time.
St Mirren started the second half brightly and were rewarded when Goncalves headed home from Teale’s cross.
Tade headed just past the post from Scobbie’s delivery as St Johnstone attempted to get back on terms, but they soon found themselves 2-0 behind.
The influential Goncalves latched onto Thompson’s header and coolly converted for his fourth goal in three games.
St Johnstone manager Steve Lomas introduced Nigel Hasselbaink and Mehdi Abeid into the action, but it was the hosts who continued to look the more likely to add to the scoring.
Thompson blasted wide from close range after some excellent build-up play from Gary Teale and St Mirren boss Danny Lennon replaced Paul McGowan with Paul Dummett in an attempt to preserve a comfortable lead.
Goncalves missed another glorious opportunity to complete his hat-trick with six minutes remaining when he missed the target after charging through on goal.
Former St Mirren midfielder Hasselbaink brought out a point-blank stop from Samson in injury-time, but it was to be their last chance and St Mirren marked a deserved win with a clean sheet.