"I lend a pencil to my friend."
Translation:저는 친구에게 연필을 빌려줍니다.
You would be using the wrong verb (and consequently wrong particle for the relevant object). 빌리다 translates to "to beg or borrow" while 빌려주다 translates to "to lend".
저는 친구에서 연필을 빌려요 translates to "I borrow a pencil from my friend." (Note that the particle attached to friend is adjusted appropriately.)
저는 친구에게 연필을 빌려줘요 translates to "I lend a pencil to my friend."