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.
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.
St Mirren started the second half brightly and were rewarded when Goncalves headed home from Gary Teale's cross.
Gregory 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 missed a 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 Nigel 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
- Craig Samson