The match was decided two minutes after half-time when a corner from Xavier Amaechi was dummied by two Arsenal players for Gilmour to score at Emirates Stadium.
The win moved Arsenal to 39 points, three points ahead of Leicester City. The Foxes have two matches left and can return to the top with a win at bottom club Sunderland at the Stadium of Light on Sunday.
The defeat puts Swansea out of title contention, five points back in fourth with one match to play.
They are level on 34 points with Liverpool, who can still win the division, with two matches remaining, beginning at Everton on Monday.
See: Swansea report
Arsenal: 20 Apr v West Ham (A) PL2
Swansea: 23 Apr v Sunderland (H) PL2