John McGrogan, 65, of Blackridge, began abusing the girls when they were aged six and 11.
The offences were committed between 1981 and 2005 at addresses in Edinburgh.
The former playground supervisor was sentenced at the High Court in Glasgow. He was earlier placed on the sex offenders register.
A judge heard how the victims finally revealed their ordeals in 2014 after McGrogan was convicted of child porn offences.
Lord Burns told McGrogan he had "exploited" the duo for his own "gratification".
He added the victim impact statements given to him had made "harrowing" reading.
McGrogan will also be supervised for a further four years on his release.
The first girl was aged 11 when she was raped. The other was attacked between the ages of six and 11.
Both told how, during the abuse, McGrogan would try and spoil them by buying sweets or computer games.
Tony Lenehan, defending said McGrogan's regret for what happened was "sincere".

The British duo dominated from the start as they finished 2.62 seconds ahead of France with Germany in third.
Two other Coleraine men Alan Campbell and Peter Chambers failed to reach the A finals in their events.
Single sculler Campbell and lightweight four team member Chambers will compete in B finals on Sunday.
The lightweight pairs is a non-Olympic class but the performances of Cassells and Scrimgeour could put them in contention for promotion to one of Britain's Rio berths for next year.
Earlier this season, Cassells and Peter Chambers won the European title in the lightweight pairs class.
Chambers and his team-mates could only manage fourth in their lightweight four semi-final with Campbell fifth in his single sculls semi-final in Aiguebelette.
The Coleraine men will attempt to secure Olympic Games spots in Sunday's B deciders.
The top five finishers in the lightweight four B final will clinch places in Rio for their countries while Campbell, 32, will need a top-three finish in his B decider to book a British berth in Brazil.
2002 Olympic bronze medallist Campbell, who missed out on selection for last year's World Championships, was always going to be up against it in Friday's semi-final.
London Olympics winner Mahe Drysdale powered to victory in 6:45.08 which left him ahead of this year's European champion Damir Martin of Croatia with 2008 Olympic gold medallist Norwegian Olaf Tufte edging out Belarus's Stanislau Shcharbachenia to take the final qualifying spot.
Campbell was a further 3.21 seconds back in fifth spot.
Chambers and his British team-mates Jonathan Clegg, Mark Aldred and Chris Bartley were never really a factor in their semi-final as they finished 7.33 seconds behind Switzerland with France and Italy also progressing to the A final.
The British quartet's performance continued their recent struggles after they also failed to make the A final at the recent Lucerne World Cup regatta.
Richard Chambers and Will Fletcher will race for Britain in the lightweight double sculls final on Saturday.
Ennisillen woman Leonara Kennedy and her Irish team-mate finished a distant fifth in the final of the non-Olympic women's four final on Friday.
A West Lothian pensioner who admitted raping two primary schoolgirls has been jailed for for eight and a half years.
[NEXT_CONCEPT]
Coleraine rower Joel Cassells and his British team-mate Sam Scrimgeour have won the lightweight pairs gold medal at the World Championships in France.