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.
After both sides enjoyed midweek victories it was surprising that the match began at a slow pace, with neither side able to turn possession into chances.
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.
Patrick Cregg dragged a shot wide before Craig Samson did well to keep out Rowan Vine's close-range shot.
Samson was again the hero as he made an excellent save from Vine's header, following an excellent delivery from David McKay.
The visitors passed up a wonderful chance to open the scoring when Steven 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 Gary Teale's cross.
Tade headed just past the post from Thomas 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.
Goncalves almost completed his hat-trick when he ended a driving run with a shot that drifted just wide of the post.
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 Teale before St Mirren boss Danny Lennon replaced Paul McGowan with Paul Dummett in an attempt to preserve a comfortable lead.
Lomas introduced Gwion Edwards in place of Patrick Cregg and the home side also made a further change as Thompson made way for Lewis Guy.
MacLean could only manage a weak header from Edwards' free-kick, then Teale flashed a free-kick just wide at the other end.
Goncalves missed another glorious opportunity to complete his hat-trick with six minutes remaining when he missed the target after charging through on goal.
Liam Craig brought out another great save from Samson as Lomas' side responded at the other end.
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.
- Sports & Recreation
- Steven Thompson
- St Johnstone
- Craig Samson
- St Mirren