This topic is a pretty detailed one since the first set of self-powered road vehicles were driven by steam engines which makes the French guy, Nicolas Joseph Cugnot, the builder of the first automobile in 1769! This was recognized both by the British Royal Automobile Club and the Automobile Club de France. However Daimler and Benz invented a highly successful and practical gasoline-powered vehicle that created the path for modern-age automobiles. Both Daimler and Benz invented cars that looked and worked like the cars we use today (pretty amazing!).
Before I go into the history of gasoline powered internal combustion engines, I would give a little description of how one works! Basically an internal combustion engine is any engine (made up of an engine block, pistons & connecting rods etc.) that uses a mixture of air and gasoline (can be considered an explosive mix) to push a piston within a cylinder. This in turn (the piston's movement), turns a crankshaft which then turns the wheels of the car via a chain or drive shaft. The main types of fuel used for combustion engines are gasoline, diesel, and kerosene.
The history of automobile gas engines is summarized below:
Year 1680 - The Dutch physicist, Christian Huygens, designed an internal combustion engine that was to be fueled with gunpowder. However he never actually built it!
Year 1807 - A Swiss guy named Francois Isaac de Rivaz invented an internal combustion engine that utilized a hydrogen and oxygen mixture as fuel. He proceeded to design a car for his engine which turned out to be the first internal combustion powered automobile. However, his design had some flaws so it proved to be a very unsuccessful design.
Year 1824 - An English engineer, Samuel Brown, modified an old steam engine to burn gas which he used briefly to power a vehicle up Shooter's Hill in London (pretty amazing!).
Year 1858 - A Belgian-born engineer named Jean Joseph Etienne Lenoir invented a double-acting, electric spark-ignition internal combustion engine fueled by coal gas. He patented it in 1860 and in 1863; he attached an improved/redesigned engine which utilized petroleum as fuel together with a carburetor to a three-wheeled wagon! The three-wheeler managed to complete a fifty-mile road trip.
Year 1862 - A French civil engineer named Alphonse Beau de Rochas patented a four-stroke engine. However he did not build it.
Year 1864 - An Austrian engineer named Siegfried Marcus, built a one-cylinder engine with a "crude" carburetor. He then attached his engine to a cart which he took for a rocky 500-foot drive. Several years later, he designed a vehicle that briefly ran at 10 mph!
Year 1873 - An American engineer named George Brayton developed an unsuccessful two-stroke kerosene engine. It utilized two external pumping cylinders. Even though it was unsuccessful, it was considered the first safe & practical oil engine.
Year 1866 - Two German engineers, Eugen Langen & Nikolaus August Otto re-designed & improved on Lenoir's and de Rochas' designs (1858 & 1862 respectively). They basically invented a more efficient gas engine.
Year 1876 - The same German engineer mentioned above, Nikolaus August Otto, invented a successful four-stroke engine, which was known as the "Otto cycle". He later patented it!
Year 1876 - Sir Dougald Clerk invented the first successful two-stroke engine (doesn't this sound familiar with motorcycles?).
Year 1883 - A French engineer, Edouard Delamare-Debouteville, built a single-cylinder four-stroke engine that ran on cooking gas. It is not actually known if he built a car to put the engine into, but his design was very advanced for that age. In some ways he was ahead of both Daimler and Benz, well at least on paper.
Year 1885 - A guy named Gottlieb Daimler invented what is known as the prototype of the modern gas engine i.e. engines with a vertical cylinders and stroke direction. It also had gasoline being injected through a carburetor. This was patented in the year 1887. The process involved Daimler building a two-wheeled vehicle known as the "Reitwagen" (Riding Carriage) with this engine first. A year later he then built the world's first four-wheeled motor vehicle.
Year 1886 - On January 29th to be exact, Karl Benz received the first patent for a gas-fueled car.
Year 1889 - Daimler continued with his invention where he built an improved four-stroke engine which contained mushroom-shaped valves and two V-slant cylinders.
Year 1890 - A guy named Wilhelm Maybach built the first four-cylinder, four-stroke engine.
The history of the automobile is actually more detailed than what is given above, but not to make the article too lengthy and boring, I decided to make it short. All of the inventors mentioned above made notable improvements in the evolution of the internal combustion engine vehicles.
In my opinion however, I think that Nicolaus Otto was one of the most important players in engine design. He was the first to essentially invent an "effective" gas motor engine. He also built the first practical four-stroke internal combustion engine called the "Otto Cycle Engine". As soon as he had completed the engine, he managed to build it into a motorcycle. In my view, Otto's contributions were very historically significant and it was his four-stoke engine that was universally adopted for all liquid-fueled automobiles!