Translation:Can you lend me a pencil?
That's fine, though there are some idiomatic differences in using "loan" versus "lend" (and their associated forms) that you can read about here:
I wrote: "Can I borrow a pencil from you?" This should be accepted. (Chinese as first language but isn't fluent.) 可以 means can I, may I or is it ok if it is a question. 借我 means borrow and 铅笔 means pencil(although I do recommend adding 一个 or 一支) And 吗 is what you put at the end of a sentence if it is a question. Thank you google translate cuz my Chinese suck and I can write Chinese. And this can't copy and paste so I have to find the pinyin.