A commanding first half from the visitors at London Road saw them take a 2-0 lead courtesy of Andy Williams's low drive and Peterborough loanee Jonathan Obika's diving header.
Peterborough rattled the crossbar through Conor Washington late on before Joe Newell halved Swindon's advantage with a superb 20-yard effort deep into stoppage time.
The result puts another dent in the promotion hopes of Darren Ferguson's men, who are now on a run of five league games without a win.
In contrast, Swindon are hot on the heels of Bristol City, who slumped to their second straight defeat with a 1-0 loss at home to third-placed Preston North End.
Callum Robinson's tap-in proved to be enough to seal the win and consign the hosts to their first home league defeat since February.
Fleetwood Town's nine-month unbeaten home league record ended with a 1-0 defeat at the hands of Walsall.
Elsewhere at the top, MK Dons are fourth following a 1-0 win over 10-man Port Vale, while Sheffield United ended a difficult week with a 1-1 draw at home to 10-man Oldham.
An ill-tempered encounter at Meadow Lane saw Notts County's Gary Jones shown a first-half red card as they slipped to a surprise 2-1 defeat at home to struggling Yeovil Town, who hauled themselves off the foot of the table.
Gary Johnson's side have now been replaced at the bottom by Crewe Alexandra, who were thumped 4-1 at fellow strugglers Leyton Orient.
Scunthorpe United blew a two-goal lead to draw 2-2 at Crawley Town, while Gary Madine scored the only goal as Coventry City earned their first away league win of the season with a 1-0 success at Colchester United.
Gillingham's Leon Legge scored an own goal and then set up Antonio German's late equaliser in a 1-1 draw at Bradford City.
In the day's only other games, Chesterfield beat Barnsley 2-1 and Doncaster Rovers were 3-1 winners over Rochdale.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1