Leon Pedley, 20, carried out the attack on Approach Road in the town after stuffing one of the victim’s socks into her mouth to stop her screaming.
A judge at the High Court in Edinburgh said a significant sentence had to be imposed for “an offence of this magnitude”, even allowing for Pedley’s age and lack of serious criminal record.
Lord Brailsford said on Monday: “The assault took place over a prolonged period of time and involved a degree of both coercion and violence.”
At an earlier trial, Pedley claimed the teenager had consented to sex, but he was found guilty by a jury of raping her on 13 March.
The jury heard that Pedley grabbed the girl by the throat and punched her before stuffing the sock into her mouth and binding her hands.
The trial then heard that Pedley later freed the girl and said he was sorry, claiming he had not wanted to do it but she had “made him”. Then, he tied her to a tree and said he was going to the toilet, but he did not return.
The girl managed to free herself and reached a path in the woods where she met a friend and the alarm was raised.