Boro took the lead through Albert Adomah's expert scissor-kick but Tony Mowbray's men were largely toothless in attack.
And, while Ipswich equalised from out of nothing, McGoldrick turning Dean Whitehead and then firing in from 25 yards, the home side controlled the second half - and the goals deservedly followed.
Luke Chambers met fellow full-back Aaron Cresswell's deep cross to put Town in the lead before man-of-the-match McGoldrick raced clear to claim the points and a 3-1 victory.
After a tight start, the visitors opened the scoring with the first meaningful shot of the match.
Ipswich initially cleared Jacob Butterfield's corner but it was sent back into the danger zone by Grant Leadbitter's powerful header and Adomah spectacular volleyed the ball past the exposed Dean Gerken.
It was Adomah's first goal since his £1million switch from Bristol City but his finish was out of keeping with a dour opening half an hour.
The best moment from the out-of-sorts home side came when Paul Anderson burst into the box but Jason Steele was equal to his effort.
Then, once again out of nothing, the hosts finally produced a moment of quality.
It was all of McGoldrick's own making as he turned Whitehead before firing an unstoppable shot beyond the despairing dive of Jason Steele.
Town almost grabbed the lead within a minute of the restart. Boro looked to have cleared the danger from McGoldrick but Frazer Richardson's pass out was seized upon by Ryan Tunnicliffe whose fierce drive from distance was well parried by Steele.
But Steele could do nothing as Ipswich took the lead for the first time on 57 minutes.
Great work on the left-hand side from Tunnicliffe and Cresswell saw the latter's deep cross headed back across goal and into the far corner by Chambers.
The visitors were again guilty of some half-hearted defending as Richardson gave the ball away to Tunnicliffe but his team mates eventually came to his rescue, deflecting McGoldrick's goalbound shot away.
The Town number 10 remained the most dangerous man on the pitch and he almost scored an early contender for goal of the season when his 30-yard shot curled just wide.
As the game opened up, the home side should have made the points safe when Murphy streaked down the left but his centre was horribly miscued by Luke Hyam, 12 yards from goal and clear of any defenders.
But it mattered not as McGoldrick burst clear of Jonathan Woodgate in injury time and rolled the ball beyond Steele and into the far corner.