Heat oil in a large heavy-bottomed saucepan over medium. Add onion; cook, stirring occasionally, until lightly golden, 8 to 10 minutes. Add tomatoes, garlic, ginger, and turmeric; cook, stirring often, until tomatoes break down, 5 to 7 minutes.
Add lentils, 1 1/2 cups water, coconut milk, salt, lemon zest and juice, black pepper, and cayenne pepper, if using, to pan; bring to a simmer over medium, stirring occasionally. Reduce heat to low; cover and simmer, stirring occasionally, until lentils are tender, 20 to 30 minutes. Season to taste with additional salt and cayenne pepper, if desired. Garnish with parsley and additional black pepper. Serve with steamed rice.