scored his first goal for the Gills to help his side brilliantly overcome promotion-chasing MK Dons and edge closer to League One safety in a 1-0 win.
The former Hull City forward struck five minutes into the second half following good work from Myles Weston
to earn the Gills their first ever victory at stadium:mk.
Manager Peter Taylor made one change to the team which lost at the MEMS Priestfield Stadium against Crewe on Saturday; ironically, it was Fagan who came into the starting line-up at the expense of Adebayo Akinfenwa, who dropped to the bench.
This meant that only six of the starting 11 played in October's reverse fixture, which heralded the Gills' first home win of the season.
And it was one of the survivors from that game, Stuart Nelson
, who was called into action on two minutes, comfortably catching Ryan Hall's dangerous cross.
Barely 60 seconds later, Nelson also had to be alert to save George Baldock's stinging 25-yard effort.
had the first shot of the evening for the visitors on four minutes, but the midfielder blazed his shot from Elliott Hewitt
's neatly-worked free-kick well wide.
did well to block Izale McLeod's shot after Sanmi Odelusi's darting run 11 minutes in, and from the resulting corner former Manchester United midfielder Alan Smith headed narrowly over.
McLeod volleyed comfortably over with 20 minutes played, and Michael Harriman
did well to get in the way of a header from Dons skipper Dean Lewington shortly after.
However as the half progressed, MK Dons ran out of ways to break down the 4-2-3-1 formation deployed by Taylor, and when they did, they came up against resolute defending.
Legge blocked Antony Kay's volley after 27 minutes, and captain Adam Barrett
thwarted Odelusi after the winger had twisted his way through the Gills' defence.
The second half was just 10 seconds old when leading scorer Cody McDonald
came close to opening the scoring. McDonald dispossessed Smith, and hit a powerful 25-yard shot at home keeper David Martin, who is the brother of Gills left back Joe.
Despite sitting immediately outside the play offs, the Dons had lost three of their previous five games at home, so it wasn't much of a surprise when Fagan opened the scoring five minutes into the second period.
After he forced his way through the home defence, Weston's low shot was well saved by Martin, and McDonald laid off Fagan, who neatly converted from 10 yards.
The adage is that teams fight even harder when they have a lead to hold on to, and that proved to be the case with the Gills.
Legge got himself in the way of Lewington's cross when McLeod was lurking dangerously on 58 minutes, Nelson saved Ben Reeves' long-range volley shortly after the hour mark and Weston diverted Dele Alli's shot wide.
Karl Robinson's team continued to probe as the game entered its final quarter, however they were still restricted to half chances.
Smith hit his 76th-minute half-volley straight at Nelson, and the keeper produced a great punch to divert another of Lewington's inswinging crosses to safety under pressure from substitute striker James Loveridge.
The Gills centre back pairing of Legge and Barrett were impressive throughout, and the former did exceptionally well to head Dean Bowditch's well-struck volley over the bar with eight minutes remaining.
Smith, on the stretch, could only knock Alli's cross well wide of the goal with time almost up, before Daniel Powell shot well over from an acute angle.
The victory moved the Gills up to 12th in the table, and crucially nine points clear of the bottom four.
However, this current run of fixtures does not get any easier for the Gills. Next up is a home game against high-flying Rotherham United on Saturday week.
Attendance: 6, 760 (Gillingham 341)
Gillingham: Nelson, Martin, Barratt, Legge, Harriman, Gregory, Hewitt, Weston, Linganzi, Fagan, McDonald
Subs not used: Baxter, Inniss, Hessenthaler, Lee, Dack, Akinfenwa, Birchall
MK Dons: Martin, Lewington, Kay, Spence, Baldock, Smith, Alli, Reeves, Hall (Powell 54), Odelusi (Bowditch 54), McLeod (Loveridge 64)
Subs not used: Burns, Randall, Galloway, Rasulo
Goals: Fagan (50)
Referee: Mr C Berry