Neither side were involved in the promotion or relegation picture, but Kenny Jackett's side made it five wins out of five in April with their fifth straight away clean sheet on Saturday.
The Lions made an impressive start, scoring inside three minutes when Keogh started and finished a move by turning in Trotter's cross at the back post.
Andy Drury should have equalised moments later, but blasted his chance off target and Michael Chopra saw his effort come back off a post in the second half.
But it was former Tractor Boy Trotter who doubled the lead in the 63rd minute. The midfielder, who was born in Ipswich and began his career at Portman Road before moving to the New Den, finished with aplomb from the edge of the area.
Grant Leadbitter had a penalty saved by Maik Taylor before Keogh rounded Arran Lee-Barrett to add a third as Millwall wrapped up their first double over Ipswich in 59 years.
Millwall's Darius Henderson was once again not fit enough to make the trip to Suffolk, but Keogh filled the void left by the absence of the Lions' top-scorer with the opening goal.
The former Wolves forward combined with strike-partner Harry Kane to release Trotter, whose cross was turned in by Keogh, his finish eluding Aaron Cresswell on the line.
The hosts could have been level within four minutes had Drury not fired wide when a good opportunity presented itself.
Tractor Boys boss Paul Jewell opted to bring on striker Jason Scotland, whose goal salvaged a point at Crystal Palace last Saturday, to give his side more attacking impetus.
And they were almost level just before the hour when Chopra struck a post.
The attacker drifted off to the left and fizzed a ball across the box which rebounded off the woodwork and fell to substitute Scotland, but his snap shot was blocked by Millwall captain Paul Robinson.
And Trotter got Jackett's side an all-important second goal when he kept his composure to sweep Jack Smith's cross into the top corner.
The home side were, however, handed a lifeline when Drury tumbled under the challenge of Smith in the penalty area seven minutes from time.
But Ipswich's miserable afternoon continued when Leadbitter's penalty was saved by Taylor who also kept out the rebound.
Keogh was on target again three minutes from time, touching the ball past the onrushing Lee-Barrett before slotting home to prompt a mass exodus from Portman Road in Ipswich's last home game of the season.