Cheltenham Town 2 Doncaster Rovers 1
Doncaster went into the game in second place but they were leapfrogged at the last by Nottingham Forest, whose 3-2 victory over Yeovil Town took them back to the Championship.
Doncaster must now face Southend in the play-off semi-finals for the right to play either Carlisle United or Leeds United at Wembley.
Doncaster can have few complaints about the result, having largely failed to turn up for the first half.
Cheltenham's players ran themselves into the ground and took the lead on 24 minutes when Alex Russell played a long ball in to Paul Connor and he laid it back to Gillespie on the corner of the penalty area.
The former Liverpool trainee manoeuvred himself into space before sending a low shot in off the far post.
Cheltenham goalkeeper Shane Higgs turned aside a half-volley from Matthew Mills at the end of the first half, but that was only the prelude to a match-winning performance by the Robins number one after the break.
Doncaster roared back into the game and Higgs dived to save a firm shot from Gareth Roberts and a header from Brian Stock to keep his team in front.
The Cheltenham defence was finally breached in the 76th minute when Paul Green fired home from a Roberts cross to set up a tense finish.
Knowing that Forest were in front, Doncaster had to attack and Higgs saved with his legs from Green, before substitute Jason Price rolled a shot against the base of a post.
Cheltenham had hardly got into the Doncaster half during the second period but they grabbed the all important second goal with five minutes remaining with a quick counter-attack.
Higgs denied Green and substitute Paul Heffernan in injury time as Cheltenham held on for a third season of League One football.