The striker, on loan from Arsenal, scored once in either half to give the Railwaymen the advantage, with Matthias Pogba securing the points with a clever finish seven minutes from time.
Amine Linganzi had levelled the score at 1-1 on the half hour mark to open his account for the Gills, but the hosts were unable to build on that momentum after the break.
Anthony Grant saw red with two minutes to go, but his dismissal came too late in the day to affect the result as Crewe clambered out of the relegation places.
Peter Taylor made three changes to the side that drew at Bradford with Michael Harriman, Steven Gregory and Adebayo Akinfenwa replacing Craig Fagan, Jake Hessenthaler and Joe Pigott – all three players dropping to the subs bench.
Callum Davies, Bradley Dack and Charlie Lee provided other options in the match day squad.
Gills had the first opportunity of the afternoon when Cody McDonald struck his right foot effort wide of the left hand post, and it was a chance which proved costly as Crewe went in front just seconds later.
The ball was delivered from the right hand side in to the penalty area, Aneke found himself surrounded by Gills defenders but after a touch of pin ball he suddenly found the ball at his feet.
Stuart Nelson came out to try and block a shot, but the forward smartly lifted it over the oncoming goalkeeper to put the visitors in front after just four minutes.
The fans inside Priestfield thought they had an equalizer just three minutes later, but Michael Harriman’s goal was disallowed with the referee believing Akinfenwa had fouled goalkeeper Ben Garrett.
Harriman finished well but the whistle had already gone, to the annoyance of the home faithful who felt it to be a legitimiate 50/50 challenge.
Crewe seemed to inheit confidence from the decision and bossed proceedings in the opening quarter of an hour – Bradden Inman and Ikpeazu in particular very much involved in the majority of the forward play.
However as the half progressed Gills got a foot hold on the game, and following half chances for McDonald and Myles Weston, they finally did draw level on 30 minutes.
Elliott Hewitt received the ball via short corner from Weston and delivered an inviting cross to the back post. Linganzi rose highest and headed beyond Garrett to register his first goal for the club since signing last summer.
Inman nearly restored the visitors’ advantage a minute after the re-start, but Nelson was down quickly to push away the midfielder’s right foot effort towards the near post.
Gillingham had the better of the play up until half time, and only a fingertip save from Garrett denied the hosts an advantage at the break when Adam Barrett’s header was well saved.
The opening few minutes of the second half were quiet with neither side particularly in control, but with the first chance of the half Crewe took the lead once again.
Matt Tootle spotted Aneke in a yard of space at the far post, and from an awkward angle the striker headed across Nelson and in to the far corner to give the visiting fans a lot to shout about as the Alex went in search of their fourth away victory of the season.
George Evans and Adam Dugdale had efforts miss the target before Bradley Dack and Charlie Lee were introduced in place of Steven Gregory and Harriman.
Lee was immediately on long throw duty, and Barrett nearly took advantage of one when he received the ball on the edge of the box and decided to shoot.
Garrett appeared confident as he left the ball, but the strike only whistled past the post as Gills began to ask a few questions of the Crewe back four.
With a point at the least within Gills grasp, Joe Pigott was brought in to the attack at the expense of Linganzi who picked up an injury seconds prior to the substitution being made.
However within a minute the Alex had made it 3-1 when Pogba latched on to Ikpeazu’s low cross, and he cleverly flicked it beyond Nelson who felt the striker had drifted in to an offside position.
Despite his appeals the flag stayed down, and with just under 10 minutes to go it gave the home side a mountain to climb if they were to achieve a result.
McDonald felt he should have had a penalty when he was brought down inside the box, but referee Stephen Bratt turned away a second appeal of the day before brandishing a red card to Anthony Grant in the final couple of minutes.
The former Chelsea midfielder had already been booked when he appeared to kick the ball away or say something untoward to one of the officials, and the referee sent him on his way as Crewe looked to count down the clock.
Peter Taylor’s side had a couple of corners to try and make something happen, but it wasn’t to be for the hosts and they now look ahead to Tuesday’s away fixture at MK Dons.
Gills: Nelson, Hewitt, Legge, Barrett, Martin, Harriman (Dack 63), Gregory (Lee 63), Linganzi (Pigott 81), Weston, McDonald, Akinfenwa.
Unused subs: Baxter, Davies, Hessenthaler, Fagan
Crewe: Garratt, Tootle, Ellis, Dugdale, Pogba, Inman, Guthrie, Evans (Osman 77), Aneke, Ikpeazu (Mellor 90), Grant.
Unused subs: Phillips, Mellor, Osman, Leitch-Smith, Moore, Ray, Park
Bookings: Ikpeazu (10), Inman (55), Linganzi (69), Osman (85), Grant (88 & 89), Lee (90).
Goals: Aneke (5 & 53), Linganzi (30), Pogba (83).
Referee: Mr S Bratt